diff --git a/lib/Alchemy/Phrasea/Controller/Root/Login.php b/lib/Alchemy/Phrasea/Controller/Root/Login.php index af346af770..a04a55cdf8 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Login.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Login.php @@ -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( diff --git a/lib/Alchemy/Phrasea/Feed/Aggregate.php b/lib/Alchemy/Phrasea/Feed/Aggregate.php index 11572d3366..e3eac68393 100644 --- a/lib/Alchemy/Phrasea/Feed/Aggregate.php +++ b/lib/Alchemy/Phrasea/Feed/Aggregate.php @@ -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'))); } } diff --git a/lib/Doctrine/Repositories/SessionRepository.php b/lib/Doctrine/Repositories/SessionRepository.php index db28453105..0c3909b012 100644 --- a/lib/Doctrine/Repositories/SessionRepository.php +++ b/lib/Doctrine/Repositories/SessionRepository.php @@ -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. *