mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 10:39:28 +00:00
Fix #1352
This commit is contained in:
@@ -98,6 +98,13 @@ class UserCompany extends BunqObject
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (\count($data) === 0 || (isset($data['id']) && (int)$data['id'] === 0)) {
|
||||
$this->id = 0;
|
||||
$this->created = new Carbon;
|
||||
$this->updated = new Carbon;
|
||||
|
||||
return;
|
||||
}
|
||||
$this->id = (int)$data['id'];
|
||||
$this->created = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['created']);
|
||||
$this->updated = Carbon::createFromFormat('Y-m-d H:i:s.u', $data['updated']);
|
||||
|
Reference in New Issue
Block a user