public function findForView($id)
    {
        $type = $this->doctrine->getConnection()->fetchColumn('SELECT type FROM page WHERE id=:id', array('id' => $id));
        if (!$type) {
            throw new NotFoundHttpException;
        }
        $types = $this->em->getClassMetadata($this->pageClassName)->discriminatorMap;

        $class = $types[$type];
        $repos = $this->em->getRepository($class);

        if ($repos instanceof ViewablePageRepository) {
            $ret = $repos->findForView($id);
        } else {
            $ret = $repos->find($id);
        }

        if (!$ret) {
            throw new NotFoundHttpException;
        }
        $this->setLoadedPage($ret);
        return $ret;
    }