]> Raphaël G. Git Repositories - airbundle/commitdiff
Replace _em now private with manager member variable
authorRaphaël Gertz <git@rapsys.eu>
Thu, 3 Dec 2026 03:03:51 +0000 (04:03 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 3 Dec 2026 03:03:51 +0000 (04:03 +0100)
Replace datetime by datetime_immutable

Repository/DanceRepository.php
Repository/GoogleTokenRepository.php
Repository/LocationRepository.php
Repository/SessionRepository.php
Repository/SlotRepository.php
Repository/SnippetRepository.php
Repository/UserRepository.php

index f7986d17c49f667fda12f4089f76085d760598cc..19028226b84d1563b7c1e956b901fb2a1b378e78 100644 (file)
@@ -54,7 +54,7 @@ SQL;
                        ->addIndexByColumn('d', 'id');
 
                //Return return
                        ->addIndexByColumn('d', 'id');
 
                //Return return
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
@@ -92,7 +92,7 @@ SQL;
                        ->addIndexByScalar('name');
 
                //Get result
                        ->addIndexByScalar('name');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getArrayResult();
 
                        ->createNativeQuery($req, $rsm)
                        ->getArrayResult();
 
@@ -153,7 +153,7 @@ SQL;
                $rsm->addScalarResult('id', 'id', 'integer');
 
                //Return result
                $rsm->addScalarResult('id', 'id', 'integer');
 
                //Return result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('nametype', $nametype)
                        //XXX: instead of array_column on the result
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('nametype', $nametype)
                        //XXX: instead of array_column on the result
@@ -191,11 +191,11 @@ SQL;
                $rsm->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('name', 'name', 'string')
                        ->addScalarResult('type', 'type', 'string')
                $rsm->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('name', 'name', 'string')
                        ->addScalarResult('type', 'type', 'string')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addIndexByScalar('id');
 
                //Get result
                        ->addIndexByScalar('id');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
@@ -297,11 +297,11 @@ SQL;
                $rsm->addScalarResult('name', 'name', 'string')
                        ->addScalarResult('ids', 'ids', 'string')
                        ->addScalarResult('types', 'types', 'string')
                $rsm->addScalarResult('name', 'name', 'string')
                        ->addScalarResult('ids', 'ids', 'string')
                        ->addScalarResult('types', 'types', 'string')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addIndexByScalar('name');
 
                //Get result
                        ->addIndexByScalar('name');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getArrayResult();
 
                        ->createNativeQuery($req, $rsm)
                        ->getArrayResult();
 
@@ -374,7 +374,7 @@ WHERE ud.user_id = :uid';
                $rsm->addFieldResult('d', 'type', 'type');
 
                //Send result
                $rsm->addFieldResult('d', 'type', 'type');
 
                //Send result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('uid', $userId)
                        ->getResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('uid', $userId)
                        ->getResult();
index 29b96d28ca8381647f7b16ad04a8f70513f1054e..4aecf6c857a761a585c823cb2deeef69ab3de8fa 100644 (file)
@@ -95,8 +95,8 @@ SQL;
                        ->addScalarResult('uid', 'uid', 'integer')
                        ->addScalarResult('access', 'access', 'string')
                        ->addScalarResult('refresh', 'refresh', 'string')
                        ->addScalarResult('uid', 'uid', 'integer')
                        ->addScalarResult('access', 'access', 'string')
                        ->addScalarResult('refresh', 'refresh', 'string')
-                       ->addScalarResult('created', 'created', 'datetime')
-                       ->addScalarResult('expired', 'expired', 'datetime')
+                       ->addScalarResult('created', 'created', 'datetime_immutable')
+                       ->addScalarResult('expired', 'expired', 'datetime_immutable')
                        ->addScalarResult('cids', 'cids', 'string')
                        ->addScalarResult('cmails', 'cmails', 'string')
                        ->addScalarResult('csummaries', 'csummaries', 'string')
                        ->addScalarResult('cids', 'cids', 'string')
                        ->addScalarResult('cmails', 'cmails', 'string')
                        ->addScalarResult('csummaries', 'csummaries', 'string')
@@ -109,7 +109,7 @@ SQL;
                $result = [];
 
                //Get tokens
                $result = [];
 
                //Get tokens
-               $tokens = $this->_em
+               $tokens = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getArrayResult();
 
                        ->createNativeQuery($req, $rsm)
                        ->getArrayResult();
 
index 9b621ef3cafe2b073c511ee42867c2bd665bf8e4..55ac403664cc6adadd82d1b0c40a90cb7eec2626 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();
@@ -753,7 +753,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();
index c310b5406458295f720cb0755a2bd66c4e865477..030dd3598c5cda9c2a132714436eb3ecc7ea1c78 100644 (file)
@@ -141,9 +141,9 @@ SQL;
                $rsm->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('date', 'date', 'date')
                        ->addScalarResult('begin', 'begin', 'time')
                $rsm->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('date', 'date', 'date')
                        ->addScalarResult('begin', 'begin', 'time')
-                       ->addScalarResult('start', 'start', 'datetime')
+                       ->addScalarResult('start', 'start', 'datetime_immutable')
                        ->addScalarResult('length', 'length', 'time')
                        ->addScalarResult('length', 'length', 'time')
-                       ->addScalarResult('stop', 'stop', 'datetime')
+                       ->addScalarResult('stop', 'stop', 'datetime_immutable')
                        ->addScalarResult('rainfall', 'rainfall', 'float')
                        ->addScalarResult('rainrisk', 'rainrisk', 'float')
                        ->addScalarResult('realfeel', 'realfeel', 'float')
                        ->addScalarResult('rainfall', 'rainfall', 'float')
                        ->addScalarResult('rainrisk', 'rainrisk', 'float')
                        ->addScalarResult('realfeel', 'realfeel', 'float')
@@ -152,9 +152,9 @@ SQL;
                        ->addScalarResult('temperature', 'temperature', 'float')
                        ->addScalarResult('temperaturemin', 'temperaturemin', 'float')
                        ->addScalarResult('temperaturemax', 'temperaturemax', 'float')
                        ->addScalarResult('temperature', 'temperature', 'float')
                        ->addScalarResult('temperaturemin', 'temperaturemin', 'float')
                        ->addScalarResult('temperaturemax', 'temperaturemax', 'float')
-                       ->addScalarResult('locked', 'locked', 'datetime')
-                       ->addScalarResult('created', 'created', 'datetime')
-                       ->addScalarResult('updated', 'updated', 'datetime')
+                       ->addScalarResult('locked', 'locked', 'datetime_immutable')
+                       ->addScalarResult('created', 'created', 'datetime_immutable')
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('l_title', 'l_title', 'string')
                        ->addScalarResult('l_description', 'l_description', 'string')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('l_title', 'l_title', 'string')
                        ->addScalarResult('l_description', 'l_description', 'string')
@@ -164,11 +164,11 @@ SQL;
                        ->addScalarResult('l_latitude', 'l_latitude', 'float')
                        ->addScalarResult('l_longitude', 'l_longitude', 'float')
                        ->addScalarResult('l_indoor', 'l_indoor', 'boolean')
                        ->addScalarResult('l_latitude', 'l_latitude', 'float')
                        ->addScalarResult('l_longitude', 'l_longitude', 'float')
                        ->addScalarResult('l_indoor', 'l_indoor', 'boolean')
-                       ->addScalarResult('l_updated', 'l_updated', 'datetime')
+                       ->addScalarResult('l_updated', 'l_updated', 'datetime_immutable')
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('a_id', 'a_id', 'integer')
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('a_id', 'a_id', 'integer')
-                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime')
+                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime_immutable')
                        ->addScalarResult('ad_id', 'ad_id', 'integer')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
                        ->addScalarResult('ad_id', 'ad_id', 'integer')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
@@ -183,7 +183,7 @@ SQL;
                        ->addScalarResult('p_profile', 'p_profile', 'text')
                        ->addScalarResult('p_rate', 'p_rate', 'integer')
                        ->addScalarResult('p_hat', 'p_hat', 'boolean')
                        ->addScalarResult('p_profile', 'p_profile', 'text')
                        ->addScalarResult('p_rate', 'p_rate', 'integer')
                        ->addScalarResult('p_hat', 'p_hat', 'boolean')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        //XXX: is a string because of \n separator
                        ->addScalarResult('sa_id', 'sa_id', 'string')
                        //XXX: is a string because of \n separator
                        //XXX: is a string because of \n separator
                        ->addScalarResult('sa_id', 'sa_id', 'string')
                        //XXX: is a string because of \n separator
@@ -201,7 +201,7 @@ SQL;
                        ->addIndexByScalar('id');
 
                //Set result
                        ->addIndexByScalar('id');
 
                //Set result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
@@ -461,7 +461,7 @@ SQL;
                        //XXX: check that latitude and longitude have not be swapped !!!
                        //XXX: latitude ~= 48.x longitude ~= 2.x
                        $locationIds = array_keys(
                        //XXX: check that latitude and longitude have not be swapped !!!
                        //XXX: latitude ~= 48.x longitude ~= 2.x
                        $locationIds = array_keys(
-                               $this->_em
+                               $this->manager
                                        ->createNativeQuery($req, $rsm)
                                        ->setParameter('latitude', $latitude)
                                        ->setParameter('longitude', $longitude)
                                        ->createNativeQuery($req, $rsm)
                                        ->setParameter('latitude', $latitude)
                                        ->setParameter('longitude', $longitude)
@@ -507,7 +507,7 @@ SQL;
 
                        //Set location ids
                        $locationIds = array_keys(
 
                        //Set location ids
                        $locationIds = array_keys(
-                               $this->_em
+                               $this->manager
                                        ->createNativeQuery($req, $rsm)
                                        ->setParameter('id', $userId)
                                        ->getArrayResult()
                                        ->createNativeQuery($req, $rsm)
                                        ->setParameter('id', $userId)
                                        ->getArrayResult()
@@ -590,10 +590,10 @@ SQL;
                        ->addScalarResult('rainfall', 'rainfall', 'float')
                        ->addScalarResult('realfeel', 'realfeel', 'float')
                        ->addScalarResult('temperature', 'temperature', 'float')
                        ->addScalarResult('rainfall', 'rainfall', 'float')
                        ->addScalarResult('realfeel', 'realfeel', 'float')
                        ->addScalarResult('temperature', 'temperature', 'float')
-                       ->addScalarResult('locked', 'locked', 'datetime')
-                       ->addScalarResult('start', 'start', 'datetime')
-                       ->addScalarResult('stop', 'stop', 'datetime')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('locked', 'locked', 'datetime_immutable')
+                       ->addScalarResult('start', 'start', 'datetime_immutable')
+                       ->addScalarResult('stop', 'stop', 'datetime_immutable')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('l_id', 'l_id', 'integer')
@@ -605,7 +605,7 @@ SQL;
                        ->addScalarResult('l_longitude', 'l_longitude', 'float')
                        ->addScalarResult('l_indoor', 'l_indoor', 'boolean')
                        ->addScalarResult('a_id', 'a_id', 'integer')
                        ->addScalarResult('l_longitude', 'l_longitude', 'float')
                        ->addScalarResult('l_indoor', 'l_indoor', 'boolean')
                        ->addScalarResult('a_id', 'a_id', 'integer')
-                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime')
+                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime_immutable')
                        ->addScalarResult('ad_id', 'ad_id', 'string')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
                        ->addScalarResult('ad_id', 'ad_id', 'string')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
@@ -627,7 +627,7 @@ SQL;
                        ->addIndexByScalar('id');
 
                //Fetch result
                        ->addIndexByScalar('id');
 
                //Fetch result
-               $res = $this->_em
+               $res = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate());
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate());
@@ -965,7 +965,7 @@ SQL;
 
                //With user dance
                if (
 
                //With user dance
                if (
-                       $userDances = $this->_em
+                       $userDances = $this->manager
                                ->createNativeQuery($req, $rsm)
                                ->setParameter('uid', $userId)
                                ->getResult(AbstractQuery::HYDRATE_SCALAR_COLUMN)
                                ->createNativeQuery($req, $rsm)
                                ->setParameter('uid', $userId)
                                ->getResult(AbstractQuery::HYDRATE_SCALAR_COLUMN)
@@ -995,7 +995,7 @@ SQL;
 
                //With user subscription
                if (
 
                //With user subscription
                if (
-                       $userSubscriptions = $this->_em
+                       $userSubscriptions = $this->manager
                                ->createNativeQuery($req, $rsm)
                                ->setParameter('uid', $userId)
                                ->getResult(AbstractQuery::HYDRATE_SCALAR_COLUMN)
                                ->createNativeQuery($req, $rsm)
                                ->setParameter('uid', $userId)
                                ->getResult(AbstractQuery::HYDRATE_SCALAR_COLUMN)
@@ -1059,10 +1059,10 @@ SQL;
                $rsm
                        ->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('date', 'date', 'date')
                $rsm
                        ->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('date', 'date', 'date')
-                       ->addScalarResult('locked', 'locked', 'datetime')
-                       ->addScalarResult('modified', 'modified', 'datetime')
-                       ->addScalarResult('start', 'start', 'datetime')
-                       ->addScalarResult('stop', 'stop', 'datetime')
+                       ->addScalarResult('locked', 'locked', 'datetime_immutable')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
+                       ->addScalarResult('start', 'start', 'datetime_immutable')
+                       ->addScalarResult('stop', 'stop', 'datetime_immutable')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('l_address', 'l_address', 'string')
                        ->addScalarResult('l_zipcode', 'l_zipcode', 'string')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('l_address', 'l_address', 'string')
                        ->addScalarResult('l_zipcode', 'l_zipcode', 'string')
@@ -1074,7 +1074,7 @@ SQL;
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('a_id', 'a_id', 'integer')
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('a_id', 'a_id', 'integer')
-                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime')
+                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime_immutable')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
                        ->addScalarResult('au_id', 'au_id', 'integer')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
                        ->addScalarResult('au_id', 'au_id', 'integer')
@@ -1094,7 +1094,7 @@ SQL;
 
                //Return sessions
                //TODO: XXX: finish here
 
                //Return sessions
                //TODO: XXX: finish here
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('dids', $userDances)
                        ->setParameter('uids', $userSubscriptions)
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('dids', $userDances)
                        ->setParameter('uids', $userSubscriptions)
@@ -1186,10 +1186,10 @@ SQL;
                //addScalarResult($sqlColName, $resColName, $type = 'string');
                $rsm->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('date', 'date', 'date')
                //addScalarResult($sqlColName, $resColName, $type = 'string');
                $rsm->addScalarResult('id', 'id', 'integer')
                        ->addScalarResult('date', 'date', 'date')
-                       ->addScalarResult('locked', 'locked', 'datetime')
-                       ->addScalarResult('updated', 'updated', 'datetime')
-                       ->addScalarResult('start', 'start', 'datetime')
-                       ->addScalarResult('stop', 'stop', 'datetime')
+                       ->addScalarResult('locked', 'locked', 'datetime_immutable')
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable')
+                       ->addScalarResult('start', 'start', 'datetime_immutable')
+                       ->addScalarResult('stop', 'stop', 'datetime_immutable')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('l_address', 'l_address', 'string')
                        ->addScalarResult('l_zipcode', 'l_zipcode', 'string')
                        ->addScalarResult('l_id', 'l_id', 'integer')
                        ->addScalarResult('l_address', 'l_address', 'string')
                        ->addScalarResult('l_zipcode', 'l_zipcode', 'string')
@@ -1201,7 +1201,7 @@ SQL;
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('a_id', 'a_id', 'integer')
                        ->addScalarResult('t_id', 't_id', 'integer')
                        ->addScalarResult('t_title', 't_title', 'string')
                        ->addScalarResult('a_id', 'a_id', 'integer')
-                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime')
+                       ->addScalarResult('a_canceled', 'a_canceled', 'datetime_immutable')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
                        ->addScalarResult('au_id', 'au_id', 'integer')
                        ->addScalarResult('ad_name', 'ad_name', 'string')
                        ->addScalarResult('ad_type', 'ad_type', 'string')
                        ->addScalarResult('au_id', 'au_id', 'integer')
@@ -1220,7 +1220,7 @@ SQL;
                        ->addIndexByScalar('id');
 
                //Fetch result
                        ->addIndexByScalar('id');
 
                //Fetch result
-               $res = $this->_em
+               $res = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate());
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('begin', $period->getStartDate())
                        ->setParameter('end', $period->getEndDate());
@@ -1273,7 +1273,7 @@ SQL;
                        ->addIndexBy('s', 'id');
 
                //Send result
                        ->addIndexBy('s', 'id');
 
                //Send result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
@@ -1322,7 +1322,7 @@ SQL;
                        ->addIndexBy('s', 'id');
 
                //Send result
                        ->addIndexBy('s', 'id');
 
                //Send result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
@@ -1364,7 +1364,7 @@ SQL;
                        ->addIndexBy('s', 'id');
 
                //Send result
                        ->addIndexBy('s', 'id');
 
                //Send result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
        }
@@ -1518,7 +1518,7 @@ SQL;
 
                //Get result
                //XXX: setting limit in subqueries is required to prevent mariadb optimisation
 
                //Get result
                //XXX: setting limit in subqueries is required to prevent mariadb optimisation
-               $applications = $this->_em
+               $applications = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('sid', $id)
                        ->getResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('sid', $id)
                        ->getResult();
@@ -1536,7 +1536,7 @@ SQL;
 
                        //Update application updated field
                        //XXX: updated field is not modified for user with bad behaviour as application is not retrieved until delay is reached
 
                        //Update application updated field
                        //XXX: updated field is not modified for user with bad behaviour as application is not retrieved until delay is reached
-                       $this->_em->getConnection()->executeUpdate($upreq, ['id' => $application->getId(), 'score' => $application->getScore()], ['id' => Types::INTEGER, 'score' => Types::FLOAT]);
+                       $this->manager->getConnection()->executeUpdate($upreq, ['id' => $application->getId(), 'score' => $application->getScore()], ['id' => Types::INTEGER, 'score' => Types::FLOAT]);
                }
 
                //Return best ranked application
                }
 
                //Return best ranked application
@@ -1550,7 +1550,7 @@ SQL;
         */
        function rekey(): bool {
                //Get connection
         */
        function rekey(): bool {
                //Get connection
-               $cnx = $this->_em->getConnection();
+               $cnx = $this->manager->getConnection();
 
                //Set the request
                $req = <<<SQL
 
                //Set the request
                $req = <<<SQL
@@ -1587,7 +1587,7 @@ SQL;
                        #->addIndexByScalar('id');
 
                //Fetch result
                        #->addIndexByScalar('id');
 
                //Fetch result
-               $rnq = $this->_em->createNativeQuery($req, $rsm);
+               $rnq = $this->manager->createNativeQuery($req, $rsm);
 
                //Get result set
                $res = $rnq->getResult();
 
                //Get result set
                $res = $rnq->getResult();
index d2b6eb36a1fd290aaaff580e065dc760479ba7a9..590f6c0f1da606ebf3fb438699b70f26d0cf7716 100644 (file)
@@ -44,7 +44,7 @@ class SlotRepository extends Repository {
                        ->addIndexByScalar('id');
 
                //Fetch result
                        ->addIndexByScalar('id');
 
                //Fetch result
-               $res = $this->_em
+               $res = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
 
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
 
index 3d53487c22901fd3089dd1fd5bee8cb3c3241c2e..c070333962a28f131a4a0779af6cadbc71f9870c 100644 (file)
 
 namespace Rapsys\AirBundle\Repository;
 
 
 namespace Rapsys\AirBundle\Repository;
 
+use Rapsys\AirBundle\Repository;
+
 /**
  * SnippetRepository
  */
 /**
  * SnippetRepository
  */
-class SnippetRepository extends \Doctrine\ORM\EntityRepository {
+class SnippetRepository extends Repository {
        /**
         * Find snippets by user id, locale and index by location id
         *
        /**
         * Find snippets by user id, locale and index by location id
         *
@@ -24,7 +26,7 @@ class SnippetRepository extends \Doctrine\ORM\EntityRepository {
         */
        public function findByUserIdLocaleIndexByLocationId(int $userId, string $locale): array {
                //Fetch snippets
         */
        public function findByUserIdLocaleIndexByLocationId(int $userId, string $locale): array {
                //Fetch snippets
-               $ret = $this->_em
+               $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)
                        ->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)
index 725e3ed3f482e3a08001d9f523549bb7ce4cfacc..403e8ab1075c0909c1df89009a7101043b820aa2 100644 (file)
@@ -69,7 +69,7 @@ SQL;
                        ->addIndexByScalar('id');
 
                //Fetch result
                        ->addIndexByScalar('id');
 
                //Fetch result
-               $res = $this->_em
+               $res = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
 
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
 
@@ -139,7 +139,7 @@ SQL;
                $rsm->addScalarResult('id', 'id', 'integer');
 
                //Return result
                $rsm->addScalarResult('id', 'id', 'integer');
 
                //Return result
-               return $this->_em
+               return $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('pseudonym', $pseudonym)
                        //XXX: instead of array_column on the result
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('pseudonym', $pseudonym)
                        //XXX: instead of array_column on the result
@@ -175,7 +175,7 @@ SQL;
                        ->addIndexByScalar('pseudonym');
 
                //Get result
                        ->addIndexByScalar('pseudonym');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $sessionId)
                        ->getArrayResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $sessionId)
                        ->getArrayResult();
@@ -246,13 +246,13 @@ SQL;
                        ->addScalarResult('phone', 'phone', 'string')
                        ->addScalarResult('pseudonym', 'pseudonym', 'string')
                        ->addScalarResult('surname', 'surname', 'string')
                        ->addScalarResult('phone', 'phone', 'string')
                        ->addScalarResult('pseudonym', 'pseudonym', 'string')
                        ->addScalarResult('surname', 'surname', 'string')
-                       ->addScalarResult('updated', 'updated', 'datetime')
+                       ->addScalarResult('updated', 'updated', 'datetime_immutable')
                        ->addScalarResult('zipcode', 'zipcode', 'string')
                        ->addScalarResult('c_id', 'c_id', 'integer')
                        ->addScalarResult('c_title', 'c_title', 'string')
                        ->addScalarResult('o_id', 'o_id', 'integer')
                        ->addScalarResult('o_title', 'o_title', 'string')
                        ->addScalarResult('zipcode', 'zipcode', 'string')
                        ->addScalarResult('c_id', 'c_id', 'integer')
                        ->addScalarResult('c_title', 'c_title', 'string')
                        ->addScalarResult('o_id', 'o_id', 'integer')
                        ->addScalarResult('o_title', 'o_title', 'string')
-                       ->addScalarResult('modified', 'modified', 'datetime')
+                       ->addScalarResult('modified', 'modified', 'datetime_immutable')
                        //XXX: is a string because of \n separator
                        ->addScalarResult('ids', 'ids', 'string')
                        //XXX: is a string because of \n separator
                        //XXX: is a string because of \n separator
                        ->addScalarResult('ids', 'ids', 'string')
                        //XXX: is a string because of \n separator
@@ -260,7 +260,7 @@ SQL;
                        ->addIndexByScalar('id');
 
                //Get result
                        ->addIndexByScalar('id');
 
                //Get result
-               $result = $this->_em
+               $result = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
                        ->createNativeQuery($req, $rsm)
                        ->setParameter('id', $id)
                        ->getOneOrNullResult();
@@ -444,7 +444,7 @@ SQL;
                        ->addScalarResult('d_types', 'd_types', 'string');
 
                //Fetch result
                        ->addScalarResult('d_types', 'd_types', 'string');
 
                //Fetch result
-               $res = $this->_em
+               $res = $this->manager
                        ->createNativeQuery($req, $rsm)
                        ->getResult();
 
                        ->createNativeQuery($req, $rsm)
                        ->getResult();