/** * Reset the unique is_home and is_showreel of the Page * * @param \CMS\Bundle\AdminBundle\Entity\Page $page */ private function resetUnique(\CMS\Bundle\AdminBundle\Entity\Page $page) { if ($page->getIsHome()) { $this->getDoctrine()->getRepository("CMSAdminBundle:Page")->resetIsHome(); $page->setIsHome(1); } if ($page->getIsShowreel()) { $this->getDoctrine()->getRepository("CMSAdminBundle:Page")->resetIsShowreel(); $page->setIsShowreel(1); } }