createdAt = new \DateTimeImmutable('now'); $this->account = new NullAccount(); $this->type = new ContractType(); } /** * Get id * * @return int * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * Get files * * @return Media[] * * @since 1.0.0 */ public function getFiles() : array { return $this->files; } /** * Add media to item * * @param Media $media Media * * @return void * * @since 1.0.0 */ public function addFile(Media $media) : void { $this->files[] = $media; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'title' => $this->title, 'description' => $this->description, 'start' => $this->start, 'end' => $this->end, 'duration' => $this->duration, 'warning' => $this->warning, 'responsible' => $this->responsible, 'createdAt' => $this->createdAt, 'costs' => $this->costs, 'type' => $this->type, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }