1: <?php
2:
3: namespace PHPixie\ORM\Wrappers;
4:
5: class Implementation implements \PHPixie\ORM\Wrappers
6: {
7: protected $databaseRepositories = array();
8: protected $databaseQueries = array();
9: protected $databaseEntities = array();
10: protected $embeddedEntities = array();
11:
12: public function databaseRepositories()
13: {
14: return $this->databaseRepositories;
15: }
16:
17: public function databaseQueries()
18: {
19: return $this->databaseQueries;
20: }
21:
22: public function databaseEntities()
23: {
24: return $this->databaseEntities;
25: }
26:
27: public function embeddedEntities()
28: {
29: return $this->embeddedEntities;
30: }
31:
32: public function databaseRepositoryWrapper($repository)
33: {
34: $method = $repository->modelName().'Repository';
35: return $this->$method($repository);
36: }
37:
38: public function databaseQueryWrapper($query)
39: {
40: $method = $query->modelName().'Query';
41: return $this->$method($query);
42: }
43:
44: public function databaseEntityWrapper($entity)
45: {
46: return $this->entityWrapper($entity);
47: }
48:
49: public function embeddedEntityWrapper($entity)
50: {
51: return $this->entityWrapper($entity);
52: }
53:
54: protected function entityWrapper($entity)
55: {
56: $method = $entity->modelName().'Entity';
57: return $this->$method($entity);
58: }
59: }