21 lines
446 B
PHP
21 lines
446 B
PHP
<?php
|
|
|
|
namespace Model;
|
|
|
|
class NewsImage extends Model {
|
|
public $id;
|
|
public $title;
|
|
public $author;
|
|
public $url;
|
|
|
|
public function __construct($data, $urlPrefix = '/') {
|
|
parent::__construct($data);
|
|
|
|
// Deserialisatie van JSON heeft url in data,
|
|
// lezen uit database heeft file en (als het goed is) urlPrefix
|
|
if(isset($data->file)) {
|
|
$this->url = $urlPrefix . $data->file;
|
|
}
|
|
}
|
|
}
|