|
@@ 67-74 (lines=8) @@
|
| 64 |
|
$qb->select('*')->from($this->getTable())->where($qb->expr()->eq('id', ':id'))->setParameter('id', $id); |
| 65 |
|
|
| 66 |
|
$row = $qb->execute()->fetch(\PDO::FETCH_ASSOC); |
| 67 |
|
if (false === $row) { |
| 68 |
|
$this->logger->warning( |
| 69 |
|
'model: model {model} with id {id} not found', |
| 70 |
|
['model' => $modelClass, 'id' => $id] |
| 71 |
|
); |
| 72 |
|
|
| 73 |
|
return null; |
| 74 |
|
} |
| 75 |
|
|
| 76 |
|
$this->cache->set($row['id'], $row); |
| 77 |
|
|
|
@@ 98-105 (lines=8) @@
|
| 95 |
|
$qb = $this->getFindByQueryBuilder($criteria)->setMaxResults(1); |
| 96 |
|
|
| 97 |
|
$row = $qb->execute()->fetch(\PDO::FETCH_ASSOC); |
| 98 |
|
if (false === $row) { |
| 99 |
|
$this->logger->warning( |
| 100 |
|
'model: model {model} with criteria {criteria} not found', |
| 101 |
|
['model' => $modelClass, 'criteria' => $criteria] |
| 102 |
|
); |
| 103 |
|
|
| 104 |
|
return null; |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
$this->cache->set($row['id'], $row); |
| 108 |
|
|