initializePage($title, $content); } public function setFile(Content $file) { $this->file = $file; } public function getFile() { return $this->file; } public function setParams(Config $params) { $this->params = $params; } /** * @param ContentType $contentType */ public function setContentType($contentType) { $this->contentType = $contentType; } protected function convertPage($content) { return $this->contentType->convert($content); } protected function generatePage() { return $this->convertPage($this->content); } public static function fromFile(Content $file, $params, ContentType $contentType) { $page = new static($file->getTitle(), $file->getContent()); $page->setFile($file); $page->setParams($params); $page->setContentType($contentType); return $page; } }