| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 20 | public function get(Identity $id, $criteria = null) |
||
| 21 | { |
||
| 22 | $data = $this->mongo->aggregate_snapshots |
||
| 23 | ->find(['identity' => (string) $id]) |
||
| 24 | ->sort(['creation_date' => -1]) |
||
| 25 | ->limit(1) |
||
| 26 | ->getNext(); |
||
| 27 | |||
| 28 | $snapshot = new Snapshot( |
||
| 29 | unserialize($data['aggregate']), |
||
| 30 | $data['version'], |
||
| 31 | $data['creation_date'] |
||
| 32 | ); |
||
| 33 | |||
| 34 | return $snapshot; |
||
| 35 | } |
||
| 36 | |||
| 47 |