createdAt = new \DateTimeImmutable('now'); $this->createdBy = new NullAccount(); } /** * Get id. * * @return int Model id * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * Get the media files * * @return array * * @since 1.0.0 */ public function getMedia() : array { return $this->media; } /** * Add a media file * * @param mixed $media Media * * @return void * * @since 1.0.0 */ public function addMedia($media) : void { $this->media[] = $media; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'description' => $this->description, 'descriptionRaw' => $this->descriptionRaw, 'card' => $this->card, 'createdBy' => $this->createdBy, 'createdAt' => $this->createdAt, 'media' => $this->media, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } }