removed findallpublic method

This commit is contained in:
Andrey
2013-08-13 19:27:34 +02:00
parent 06bf968e39
commit 3f09a919ed
3 changed files with 2 additions and 18 deletions

View File

@@ -725,7 +725,7 @@ class Login implements ControllerProviderInterface
$app->addFlash('error', _('login::erreur: No available connection - Please contact sys-admin'));
}
$feeds = $app['EM']->getRepository('Entities\Feed')->findAllPublic();
$feeds = $app['EM']->getRepository('Entities\Feed')->findBy(array('public' => true), array('updated_on' => 'DESC'));
$form = $app->form(new PhraseaAuthenticationForm());
$form->setData(array(

View File

@@ -227,6 +227,6 @@ class Aggregate implements FeedInterface
*/
public static function getPublic(Application $app)
{
return new static($app['EM'], $app['EM']->getRepository('Entities\Feed')->findAllPublic());
return new static($app['EM'], $app['EM']->getRepository('Entities\Feed')->findBy(array('public' => true), array('updated_on' => 'DESC')));
}
}

View File

@@ -49,22 +49,6 @@ class SessionRepository extends EntityRepository
return $query->getResult();
}
/**
* Returns all the public feeds.
*
* @return Collection
*/
public function findAllPublic()
{
$dql = 'SELECT f FROM Entities\Feed f
WHERE f.public = true
ORDER BY f.updated_on DESC';
$query = $this->_em->createQuery($dql);
return $query->getResult();
}
/**
* Returns the given feed if the user can access to it.
*