]> Raphaƫl G. Git Repositories - airbundle/blobdiff - Repository/LocationRepository.php
Version 0.6.1
[airbundle] / Repository / LocationRepository.php
index 9b621ef3cafe2b073c511ee42867c2bd665bf8e4..9a7355f1070cb76c619bb034381ae18d1ed5eace 100644 (file)
@@ -73,10 +73,10 @@ SQL;
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('indoor', 'indoor', 'boolean')
                        ->addScalarResult('count', 'count', 'integer')
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('indoor', 'indoor', 'boolean')
                        ->addScalarResult('count', 'count', 'integer')
-                       ->addScalarResult('updated', 'updated', 'datetime');
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable');
 
                //Get result
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
@@ -174,11 +174,11 @@ SQL;
                        ->addScalarResult('indoors', 'indoors', 'string')
                        //XXX: is a string because of \n separator
                        ->addScalarResult('counts', 'counts', 'string')
                        ->addScalarResult('indoors', 'indoors', 'string')
                        //XXX: is a string because of \n separator
                        ->addScalarResult('counts', 'counts', 'string')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addIndexByScalar('city');
 
                //Get result
                        ->addIndexByScalar('city');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
@@ -291,11 +291,11 @@ SQL;
                        ->addScalarResult('city', 'city', 'string')
                        ->addScalarResult('latitude', 'latitude', 'float')
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('city', 'city', 'string')
                        ->addScalarResult('latitude', 'latitude', 'float')
                        ->addScalarResult('longitude', 'longitude', 'float')
-                       ->addScalarResult('updated', 'updated', 'datetime')
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable')
                        ->addIndexByScalar('city');
 
                //Get result
                        ->addIndexByScalar('city');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('latitude', $latitude)
                        ->setParameter('longitude', $longitude)
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('latitude', $latitude)
                        ->setParameter('longitude', $longitude)
@@ -396,13 +396,13 @@ SQL;
                        ->addScalarResult('title', 'title', 'string')
                        ->addScalarResult('latitude', 'latitude', 'float')
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('title', 'title', 'string')
                        ->addScalarResult('latitude', 'latitude', 'float')
                        ->addScalarResult('longitude', 'longitude', 'float')
-                       ->addScalarResult('created', 'created', 'datetime')
-                       ->addScalarResult('updated', 'updated', 'datetime')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('created', 'created', 'datetime_immutable')
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addScalarResult('count', 'count', 'integer');
 
                //Get result
                        ->addScalarResult('count', 'count', 'integer');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
@@ -529,14 +529,14 @@ SQL;
                        ->addScalarResult('city', 'city', 'string')
                        ->addScalarResult('latitude', 'latitude', 'float')
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('city', 'city', 'string')
                        ->addScalarResult('latitude', 'latitude', 'float')
                        ->addScalarResult('longitude', 'longitude', 'float')
-                       ->addScalarResult('created', 'created', 'datetime')
-                       ->addScalarResult('updated', 'updated', 'datetime')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('created', 'created', 'datetime_immutable')
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addScalarResult('pcount', 'pcount', 'integer')
                        ->addScalarResult('tcount', 'tcount', 'integer');
 
                //Get result
                        ->addScalarResult('pcount', 'pcount', 'integer')
                        ->addScalarResult('tcount', 'tcount', 'integer');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate())
@@ -624,14 +624,14 @@ SQL;
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('indoor', 'indoor', 'boolean')
                        ->addScalarResult('zipcode', 'zipcode', 'string')
                        ->addScalarResult('longitude', 'longitude', 'float')
                        ->addScalarResult('indoor', 'indoor', 'boolean')
                        ->addScalarResult('zipcode', 'zipcode', 'string')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addScalarResult('city_id', 'city_id', 'integer')
                        ->addScalarResult('city_latitude', 'city_latitude', 'float')
                        ->addScalarResult('city_longitude', 'city_longitude', 'float')
                        ->addIndexByScalar('id');
 
                //Get result
                        ->addScalarResult('city_id', 'city_id', 'integer')
                        ->addScalarResult('city_latitude', 'city_latitude', 'float')
                        ->addScalarResult('city_longitude', 'city_longitude', 'float')
                        ->addIndexByScalar('id');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
@@ -719,7 +719,8 @@ SQL;
                return array_column(
                        $this->getEntityManager()
                                #->createQuery('SELECT l.id, l.title FROM Rapsys\AirBundle\Entity\Location l JOIN Rapsys\AirBundle\Entity\Session s WITH s.id = :sid LEFT JOIN Rapsys\AirBundle\Entity\Session s2 WITH s2.id != s.id AND s2.slot = s.slot AND s2.date = s.date WHERE l.id != s.location AND s2.location IS NULL GROUP BY l.id ORDER BY l.id')
                return array_column(
                        $this->getEntityManager()
                                #->createQuery('SELECT l.id, l.title FROM Rapsys\AirBundle\Entity\Location l JOIN Rapsys\AirBundle\Entity\Session s WITH s.id = :sid LEFT JOIN Rapsys\AirBundle\Entity\Session s2 WITH s2.id != s.id AND s2.slot = s.slot AND s2.date = s.date WHERE l.id != s.location AND s2.location IS NULL GROUP BY l.id ORDER BY l.id')
-                               ->createQuery('SELECT l.id, l.title FROM Rapsys\AirBundle\Entity\Session s LEFT JOIN Rapsys\AirBundle\Entity\Session s2 WITH s2.id != s.id AND s2.slot = s.slot AND s2.date = s.date LEFT JOIN Rapsys\AirBundle\Entity\Location l WITH l.id != s.location AND (l.id != s2.location OR s2.location IS NULL) WHERE s.id = :sid GROUP BY l.id ORDER BY l.id')
+                               #->createQuery('SELECT l.id, l.title FROM Rapsys\AirBundle\Entity\Session s LEFT JOIN Rapsys\AirBundle\Entity\Session s2 WITH s2.id != s.id AND s2.slot = s.slot AND s2.date = s.date LEFT JOIN Rapsys\AirBundle\Entity\Location l WITH l.id != s.location AND (l.id != s2.location OR s2.location IS NULL) WHERE s.id = :sid GROUP BY l.id ORDER BY l.id')
+                               ->createQuery('SELECT l.id, l.title FROM Rapsys\AirBundle\Entity\Session s LEFT JOIN Rapsys\AirBundle\Entity\Session s2 ON s2.id != s.id AND s2.slot = s.slot AND s2.date = s.date LEFT JOIN Rapsys\AirBundle\Entity\Location l ON l.id != s.location AND (l.id != s2.location OR s2.location IS NULL) WHERE s.id = :sid GROUP BY l.id ORDER BY l.id')
                                ->setParameter('sid', $id)
                                ->getArrayResult(),
                        'id',
                                ->setParameter('sid', $id)
                                ->getArrayResult(),
                        'id',
@@ -753,7 +754,7 @@ WHERE ul.user_id = :id';
                        ->addFieldResult('l', 'title', 'title');
 
                //Send result
                        ->addFieldResult('l', 'title', 'title');
 
                //Send result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $userId)
                        ->getResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $userId)
                        ->getResult();