1: <?php
2:
3: namespace PHPixie\ORM\Relationships\Relationship;
4:
5: abstract class Implementation implements \PHPixie\ORM\Relationships\Relationship
6: {
7: protected $configs;
8: protected $models;
9: protected $planners;
10: protected $plans;
11: protected $steps;
12: protected $loaders;
13: protected $mappers;
14:
15: protected $handler;
16:
17: public function __construct($configs, $models, $planners, $plans, $steps, $loaders, $mappers)
18: {
19: $this->configs = $configs;
20: $this->models = $models;
21: $this->planners = $planners;
22: $this->plans = $plans;
23: $this->steps = $steps;
24: $this->loaders = $loaders;
25: $this->mappers = $mappers;
26: }
27:
28: public function getSides($configSlice)
29: {
30: $config = $this->config($configSlice);
31: $sides = array();
32: foreach($this->sideTypes($config) as $type) {
33: $sides[] = $this->side($type, $config);
34: }
35: return $sides;
36: }
37:
38: public function handler()
39: {
40: if ($this->handler === null) {
41: $this->handler = $this->buildHandler();
42: }
43:
44: return $this->handler;
45: }
46:
47: abstract public function entityProperty($side, $entity);
48:
49: abstract protected function buildHandler();
50: abstract protected function config($config);
51: abstract protected function side($type, $config);
52: abstract protected function sideTypes($config);
53:
54: }
55: