| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 34 | public function readLatest($id) |
||
| 35 | { |
||
| 36 | $redisKey = "{$this->getCacheNamespace()}{$id}:{$this->getType()}:latest"; |
||
| 37 | |||
| 38 | $queryObject = new QueryObject; |
||
| 39 | $queryObject->addWhere([ |
||
| 40 | 'col' => 'result', |
||
| 41 | 'value' => $id |
||
| 42 | ]); |
||
| 43 | |||
| 44 | $queryObject->setOrderBy('result'); |
||
| 45 | $queryObject->setOrderByDirection('desc'); |
||
| 46 | $queryObject->setLimit(1); |
||
| 47 | |||
| 48 | $this->setCacheExpireTime(60); |
||
| 49 | |||
| 50 | return $this->cacheAndReturn( |
||
| 51 | $this->repository->read($queryObject), |
||
| 52 | $redisKey |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |