1 parent
9bee381f6c
commit
30893eb7a7
21 files changed
+276
-85
No files matched your search
@@ -12,7 +12,24 @@ class Track extends Model {
|
||||
public $isLayout;
|
||||
|
||||
public function __construct($data) {
|
||||
// Convert arrays to objects for consistent handling
|
||||
if(is_array($data)) {
|
||||
$data = (object) $data;
|
||||
}
|
||||
|
||||
parent::__construct($data);
|
||||
|
||||
// Ensure string fields are not arrays
|
||||
if(is_array($this->title)) {
|
||||
$this->title = $this->title[0] ?? '';
|
||||
}
|
||||
if(is_array($this->itemCode)) {
|
||||
$this->itemCode = $this->itemCode[0] ?? '';
|
||||
}
|
||||
if(is_array($this->artist)) {
|
||||
$this->artist = $this->artist[0] ?? '';
|
||||
}
|
||||
|
||||
parent::ConvertToDateTime($this->start);
|
||||
parent::ConvertToDateTime($this->ends);
|
||||
$isLayout = $this->isLayout();
|
||||
|
||||
Reference in new issue
Block a user