mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
change sql params form
This commit is contained in:
@@ -86,26 +86,26 @@ class LegacyRecordRepository implements RecordRepository
|
|||||||
{
|
{
|
||||||
static $sql;
|
static $sql;
|
||||||
|
|
||||||
$params = [];
|
|
||||||
$types = [];
|
|
||||||
|
|
||||||
if (!$sql) {
|
if (!$sql) {
|
||||||
$qb = $this->createSelectBuilder()
|
$qb = $this->createSelectBuilder()
|
||||||
->where('sha256 = :sha256');
|
->where('sha256 = :sha256');
|
||||||
|
|
||||||
$params['sha256'] = $sha256;
|
|
||||||
|
|
||||||
if (!empty($excludedCollIds)) {
|
if (!empty($excludedCollIds)) {
|
||||||
$qb->andWhere($qb->expr()->notIn('coll_id', ':coll_id'));
|
$qb->andWhere($qb->expr()->notIn('coll_id', ':coll_id'));
|
||||||
|
|
||||||
$params['coll_id'] = $excludedCollIds;
|
|
||||||
$types[':coll_id'] = Connection::PARAM_INT_ARRAY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = $qb->getSQL();
|
$sql = $qb->getSQL();
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->databox->get_connection()->fetchAll($sql, $params, $types);
|
$result = $this->databox->get_connection()->fetchAll($sql,
|
||||||
|
[
|
||||||
|
'sha256' => $sha256,
|
||||||
|
'coll_id' => $excludedCollIds
|
||||||
|
],
|
||||||
|
[
|
||||||
|
':coll_id' => Connection::PARAM_INT_ARRAY
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
return $this->mapRecordsFromResultSet($result);
|
return $this->mapRecordsFromResultSet($result);
|
||||||
}
|
}
|
||||||
@@ -136,26 +136,26 @@ class LegacyRecordRepository implements RecordRepository
|
|||||||
{
|
{
|
||||||
static $sql;
|
static $sql;
|
||||||
|
|
||||||
$params = ['uuid' => $uuid];
|
|
||||||
$types = [];
|
|
||||||
|
|
||||||
if (!$sql) {
|
if (!$sql) {
|
||||||
$qb = $this->createSelectBuilder()
|
$qb = $this->createSelectBuilder()
|
||||||
->where('uuid = :uuid');
|
->where('uuid = :uuid');
|
||||||
|
|
||||||
$params['uuid'] = $uuid;
|
|
||||||
|
|
||||||
if (!empty($excludedCollIds)) {
|
if (!empty($excludedCollIds)) {
|
||||||
$qb->andWhere($qb->expr()->notIn('coll_id', ':coll_id'));
|
$qb->andWhere($qb->expr()->notIn('coll_id', ':coll_id'));
|
||||||
|
|
||||||
$params['coll_id'] = $excludedCollIds;
|
|
||||||
$types[':coll_id'] = Connection::PARAM_INT_ARRAY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = $qb->getSQL();
|
$sql = $qb->getSQL();
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->databox->get_connection()->fetchAll($sql, $params, $types);
|
$result = $this->databox->get_connection()->fetchAll($sql,
|
||||||
|
[
|
||||||
|
'uuid' => $uuid,
|
||||||
|
'coll_id' => $excludedCollIds
|
||||||
|
],
|
||||||
|
[
|
||||||
|
':coll_id' => Connection::PARAM_INT_ARRAY
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
return $this->mapRecordsFromResultSet($result);
|
return $this->mapRecordsFromResultSet($result);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user