1: <?php
2:
3: namespace PHPixie\ORM\Loaders\Loader\Proxy;
4:
5: class Caching extends \PHPixie\ORM\Loaders\Loader\Proxy
6: {
7: protected $entities = array();
8:
9: public function getByOffset($offset)
10: {
11: if(!array_key_exists($offset, $this->entities))
12: $this->entities[$offset] = $this->loader->getByOffset($offset);
13:
14: return $this->entities[$offset];
15: }
16:
17: public function offsetExists($offset)
18: {
19: return array_key_exists($offset, $this->entities) || $this->loader->offsetExists($offset);
20: }
21:
22: }
23: