Replace datetime by datetime_immutable
->addIndexByColumn('d', 'id');
//Return return
->addIndexByColumn('d', 'id');
//Return return
->createNativeQuery($req, $rsm)
->getResult();
}
->createNativeQuery($req, $rsm)
->getResult();
}
->addIndexByScalar('name');
//Get result
->addIndexByScalar('name');
//Get result
+ $result = $this->manager
->createNativeQuery($req, $rsm)
->getArrayResult();
->createNativeQuery($req, $rsm)
->getArrayResult();
$rsm->addScalarResult('id', 'id', 'integer');
//Return result
$rsm->addScalarResult('id', 'id', 'integer');
//Return result
->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
$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->manager
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
$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->manager
->createNativeQuery($req, $rsm)
->getArrayResult();
->createNativeQuery($req, $rsm)
->getArrayResult();
$rsm->addFieldResult('d', 'type', 'type');
//Send result
$rsm->addFieldResult('d', 'type', 'type');
//Send result
->createNativeQuery($req, $rsm)
->setParameter('uid', $userId)
->getResult();
->createNativeQuery($req, $rsm)
->setParameter('uid', $userId)
->getResult();
->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')
$result = [];
//Get tokens
$result = [];
//Get tokens
+ $tokens = $this->manager
->createNativeQuery($req, $rsm)
->getArrayResult();
->createNativeQuery($req, $rsm)
->getArrayResult();
->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');
+ $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())
->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->manager
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate())
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate())
->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->manager
->createNativeQuery($req, $rsm)
->setParameter('latitude', $latitude)
->setParameter('longitude', $longitude)
->createNativeQuery($req, $rsm)
->setParameter('latitude', $latitude)
->setParameter('longitude', $longitude)
->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->manager
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate())
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate())
->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->manager
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate())
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate())
->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->manager
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
->addFieldResult('l', 'title', 'title');
//Send result
->addFieldResult('l', 'title', 'title');
//Send result
->createNativeQuery($req, $rsm)
->setParameter('id', $userId)
->getResult();
->createNativeQuery($req, $rsm)
->setParameter('id', $userId)
->getResult();
$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')
->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')
->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')
->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
->addIndexByScalar('id');
//Set result
->addIndexByScalar('id');
//Set result
+ $result = $this->manager
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
//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(
->createNativeQuery($req, $rsm)
->setParameter('latitude', $latitude)
->setParameter('longitude', $longitude)
->createNativeQuery($req, $rsm)
->setParameter('latitude', $latitude)
->setParameter('longitude', $longitude)
//Set location ids
$locationIds = array_keys(
//Set location ids
$locationIds = array_keys(
->createNativeQuery($req, $rsm)
->setParameter('id', $userId)
->getArrayResult()
->createNativeQuery($req, $rsm)
->setParameter('id', $userId)
->getArrayResult()
->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')
->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')
->addIndexByScalar('id');
//Fetch result
->addIndexByScalar('id');
//Fetch result
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate());
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate());
- $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)
//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)
$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')
->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')
//Return sessions
//TODO: XXX: finish here
//Return sessions
//TODO: XXX: finish here
->createNativeQuery($req, $rsm)
->setParameter('dids', $userDances)
->setParameter('uids', $userSubscriptions)
->createNativeQuery($req, $rsm)
->setParameter('dids', $userDances)
->setParameter('uids', $userSubscriptions)
//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')
->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')
->addIndexByScalar('id');
//Fetch result
->addIndexByScalar('id');
//Fetch result
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate());
->createNativeQuery($req, $rsm)
->setParameter('begin', $period->getStartDate())
->setParameter('end', $period->getEndDate());
->addIndexBy('s', 'id');
//Send result
->addIndexBy('s', 'id');
//Send result
->createNativeQuery($req, $rsm)
->getResult();
}
->createNativeQuery($req, $rsm)
->getResult();
}
->addIndexBy('s', 'id');
//Send result
->addIndexBy('s', 'id');
//Send result
->createNativeQuery($req, $rsm)
->getResult();
}
->createNativeQuery($req, $rsm)
->getResult();
}
->addIndexBy('s', 'id');
//Send result
->addIndexBy('s', 'id');
//Send result
->createNativeQuery($req, $rsm)
->getResult();
}
->createNativeQuery($req, $rsm)
->getResult();
}
//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();
//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
*/
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
#->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();
->addIndexByScalar('id');
//Fetch result
->addIndexByScalar('id');
//Fetch result
->createNativeQuery($req, $rsm)
->getResult();
->createNativeQuery($req, $rsm)
->getResult();
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
*
*/
public function findByUserIdLocaleIndexByLocationId(int $userId, string $locale): array {
//Fetch snippets
*/
public function findByUserIdLocaleIndexByLocationId(int $userId, string $locale): array {
//Fetch snippets
->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)
->addIndexByScalar('id');
//Fetch result
->addIndexByScalar('id');
//Fetch result
->createNativeQuery($req, $rsm)
->getResult();
->createNativeQuery($req, $rsm)
->getResult();
$rsm->addScalarResult('id', 'id', 'integer');
//Return result
$rsm->addScalarResult('id', 'id', 'integer');
//Return result
->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
->addIndexByScalar('pseudonym');
//Get result
->addIndexByScalar('pseudonym');
//Get result
+ $result = $this->manager
->createNativeQuery($req, $rsm)
->setParameter('id', $sessionId)
->getArrayResult();
->createNativeQuery($req, $rsm)
->setParameter('id', $sessionId)
->getArrayResult();
->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
->addIndexByScalar('id');
//Get result
->addIndexByScalar('id');
//Get result
+ $result = $this->manager
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
->createNativeQuery($req, $rsm)
->setParameter('id', $id)
->getOneOrNullResult();
->addScalarResult('d_types', 'd_types', 'string');
//Fetch result
->addScalarResult('d_types', 'd_types', 'string');
//Fetch result
->createNativeQuery($req, $rsm)
->getResult();
->createNativeQuery($req, $rsm)
->getResult();