createdBy = new NullAccount(); $this->createdAt = new \DateTimeImmutable('now'); $this->publish = new \DateTime('now'); } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'title' => $this->title, 'plain' => $this->plain, 'content' => $this->content, 'type' => $this->type, 'status' => $this->status, 'isFeatured' => $this->isFeatured, 'publish' => $this->publish, 'createdAt' => $this->createdAt, 'createdBy' => $this->createdBy, ]; } /** * {@inheritdoc} */ public function jsonSerialize() : mixed { return $this->toArray(); } use \Modules\Media\Models\MediaListTrait; }