]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Repository/SnippetRepository.php
Replace _em now private with manager member variable
[airbundle] / Repository / SnippetRepository.php
index 2da863e1ff66af6f5dacfa79d7fdbd639deffa8f..c070333962a28f131a4a0779af6cadbc71f9870c 100644 (file)
 
 namespace Rapsys\AirBundle\Repository;
 
+use Rapsys\AirBundle\Repository;
+
 /**
  * SnippetRepository
  */
-class SnippetRepository extends \Doctrine\ORM\EntityRepository {
+class SnippetRepository extends Repository {
        /**
         * Find snippets by user id, locale and index by location id
         *
@@ -24,8 +26,8 @@ class SnippetRepository extends \Doctrine\ORM\EntityRepository {
         */
        public function findByUserIdLocaleIndexByLocationId(int $userId, string $locale): array {
                //Fetch snippets
-               $ret = $this->_em
-                       ->createQuery('SELECT s FROM RapsysAirBundle:Snippet s INDEX BY s.location WHERE s.locale = :locale and s.user = :user')
+               $ret = $this->manager
+                       ->createQuery('SELECT s FROM Rapsys\AirBundle\Entity\Snippet s INDEX BY s.location WHERE s.locale = :locale and s.user = :user')
                        ->setParameter('user', $userId)
                        ->setParameter('locale', $locale)
                        ->getResult();