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