/** * Allows to know if a page has already visted * @param \Sdz\BlogBundle\Entity\Page $page */ public function hasAlreadyVisitedPage(\Sdz\BlogBundle\Entity\Page $page) { if ($this->pages !== null) { foreach ($this->pages as $currentPage) { if ($currentPage->getNom() == $page->getNom()) { return true; } } } return false; }
/** * Allows to create a page in database. */ private function createPage($pageName) { $page = new Page(); $page->setNom($pageName); $this->createObject($page); return $page; }