code: public function findPageBy($repository, $conditions)
      {
          $ret = $this->em->getRepository($repository)->findOneBy($conditions);
          if (!$ret) {
              throw new NotFoundHttpException;
          }
          return $ret;
      }
docs: Finds a page in the specified repository by the specified conditions.
  
  @param string $repository
  @param array $conditions
  @return null|object
  
  @throws NotFoundHttpException