Model classes van API repo naar deze repo verplaatst

This commit is contained in:
NH Gooi
2024-09-29 19:05:03 +02:00
parent 8d1e79f1b7
commit 9698f9b103
17 changed files with 674 additions and 29 deletions

20
app/Models/NewsImage.php Normal file
View File

@@ -0,0 +1,20 @@
<?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;
}
}
}