account = $account; } public function getAccount() { return $this->account; } public function getId() : int { return $this->id; } public function getHistory() : array { return $this->history; } public function getNewestHistory() : EmployeeHistory { return empty($this->history) ? new NullEmployeeHistory : end($this->history); } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'account' => $this->account, ]; } /** * {@inheritdoc} */ public function __toString() { return (string) \json_encode($this->toArray()); } /** * {@inheritdoc} */ public function jsonSerialize() { return $this->toArray(); } }