mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-15 12:18:42 +00:00
datetime is jsonserializable, didn't know that :)
This commit is contained in:
parent
a5258e3301
commit
757dc81e2d
|
|
@ -275,13 +275,13 @@ class EmployeeHistory implements ArrayableInterface, \JsonSerializable
|
||||||
public function toArray() : array
|
public function toArray() : array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'employee' => !\is_int($this->employee) ? $this->employee->getId() : $this->employee,
|
'employee' => !\is_int($this->employee) ? $this->employee->getId() : $this->employee,
|
||||||
'unit' => $this->unit,
|
'unit' => $this->unit,
|
||||||
'department' => $this->department,
|
'department' => $this->department,
|
||||||
'position' => $this->position,
|
'position' => $this->position,
|
||||||
'start' => $this->start->format('Y-m-d H:i:s'),
|
'start' => $this->start,
|
||||||
'end' => $this->end === null ? null : $this->end->format('Y-m-d H:i:s'),
|
'end' => $this->end,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user