1: <?php
2:
3: namespace PHPixie\ORM\Relationships\Type\Embeds\Type;
4:
5: class One extends \PHPixie\ORM\Relationships\Type\Embeds
6: {
7: public function entityProperty($side, $entity)
8: {
9: return new One\Property\Entity\Item($this->handler(), $side, $entity);
10: }
11:
12: public function preloader()
13: {
14: return new One\Preloader();
15: }
16:
17: public function preloadResult($reusableResult, $embeddedPrefix)
18: {
19: return new One\Preload\Result($reusableResult, $embeddedPrefix);
20: }
21:
22: protected function config($configSlice)
23: {
24: return new One\Side\Config($this->configs->inflector(), $configSlice);
25: }
26:
27: protected function side($type, $config)
28: {
29: return new One\Side($type, $config);
30: }
31:
32: protected function sideTypes($config)
33: {
34: return array('item');
35: }
36:
37: protected function buildHandler()
38: {
39: return new One\Handler(
40: $this->models,
41: $this->planners,
42: $this->plans,
43: $this->steps,
44: $this->loaders,
45: $this->mappers,
46: $this
47: );
48: }
49:
50: }
51: