forked from Public/pics
ManageAssets: add thumbnails to asset table
This commit is contained in:
@@ -32,7 +32,7 @@ class Asset
|
||||
$this->$attribute = $value;
|
||||
}
|
||||
|
||||
if (!empty($data['date_captured']) && $data['date_captured'] !== 'NULL')
|
||||
if (isset($data['date_captured']) && $data['date_captured'] !== 'NULL' && !is_object($data['date_captured']))
|
||||
$this->date_captured = new DateTime($data['date_captured']);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class Asset
|
||||
'_' => '_',
|
||||
]);
|
||||
|
||||
return $return_format == 'object' ? new Asset($row) : $row;
|
||||
return $return_format === 'object' ? new static($row) : $row;
|
||||
}
|
||||
|
||||
public static function fromIds(array $id_assets, $return_format = 'array')
|
||||
@@ -168,7 +168,7 @@ class Asset
|
||||
foreach ($thumbnails as $thumb)
|
||||
$assets[$thumb[0]]['thumbnails'][$thumb[1]] = $thumb[2];
|
||||
|
||||
if ($return_format == 'array')
|
||||
if ($return_format === 'array')
|
||||
return $assets;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user