1: <?php
2:
3: namespace PHPixie\ORM\Relationships\Type\OneTo\Type\One\Property;
4:
5: class Entity extends \PHPixie\ORM\Relationships\Type\OneTo\Property\Entity\Single
6: {
7:
8: protected function load()
9: {
10: $value = $this->handler->loadProperty($this->side, $this->entity);
11: }
12:
13: protected function linkPlan($value)
14: {
15: $config = $this->side->config();
16: list($owner, $item) = $this->getSides($value);
17: return $this->handler->linkPlan($config, $owner, $item);
18: }
19:
20: protected function setProperties($value)
21: {
22: $config = $this->side->config();
23: list($owner, $item) = $this->getSides($value);
24: $this->handler->linkProperties($config, $owner, $item);
25: }
26:
27: protected function unlinkPlan()
28: {
29: return $this->handler->unlinkPlan($this->side, $this->entity);
30: }
31:
32: protected function unsetProperties()
33: {
34: $this->handler->unlinkProperties($this->side, $this->entity);
35: }
36:
37: protected function getSides($opposing)
38: {
39: if ($this->side->type() === 'item')
40: return array($this->entity, $opposing);
41:
42: return array($opposing, $this->entity);
43: }
44: }
45: