@@ -14,7 +14,23 @@ class Blog extends Model {
|
||||
public $url;
|
||||
|
||||
public function __construct($data, $images = null, $podcast = null) {
|
||||
// Convert arrays to objects for consistent handling
|
||||
if(is_array($data)) {
|
||||
$data = (object) $data;
|
||||
}
|
||||
|
||||
parent::__construct($data);
|
||||
|
||||
// Ensure id is a string, not an array
|
||||
if(is_array($this->id)) {
|
||||
$this->id = $this->id[0] ?? '';
|
||||
}
|
||||
|
||||
// Ensure title is a string, not an array
|
||||
if(is_array($this->title)) {
|
||||
$this->title = $this->title[0] ?? '';
|
||||
}
|
||||
|
||||
parent::ConvertToDateTime($this->start_date);
|
||||
parent::ConvertToDateTime($this->end_date);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user