lastUpdated = $data['last_updated']; $this->title = $data['title']; $this->content = $data['content']; } /** * Retrieves the timestamp of the last update. * * @return int The last updated timestamp. */ public function getLastUpdated(): int { return $this->lastUpdated; } /** * Retrieves the title property. * * @return string The title value. */ public function getTitle(): string { return $this->title; } /** * Retrieves the content stored in the instance. * * @return string The content as a string. */ public function getContent(): string { return $this->content; } /** * @inheritDoc */ public static function fromArray(array $data): object { return new self($data); } /** * @inheritDoc */ public function toArray(): array { return [ 'last_updated' => $this->lastUpdated, 'content_type' => $this->contentType, 'title' => $this->title, 'content' => $this->content ]; } }