session = $session ?? new NullSession(); $this->datetime = $datetime ?? new \DateTime('now'); } /** * Get id. * * @return int Account id * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * Get the session element status * * @return int * * @since 1.0.0 */ public function getStatus() : int { return $this->status; } /** * Set the session element status * * @param int $status Session element status * * @return void * * @since 1.0.0 */ public function setStatus(int $status) : void { $this->status = $status; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'status' => $this->status, 'datetime' => $this->datetime, 'session' => $this->session, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }