1: <?php
2:
3: namespace PHPixie\ORM\Relationships\Type\OneTo\Type\One\Property;
4:
5: class Query extends \PHPixie\ORM\Relationships\Type\OneTo\Property\Query\Single
6: {
7: protected function linkPlan($value)
8: {
9: $config = $this->side->config();
10: list($owner, $item) = $this->getSides($value);
11: return $this->handler->linkPlan($config, $owner, $item);
12: }
13:
14: protected function resetProperties($value)
15: {
16: return $this->handler->resetProperties($this->side, $value);
17: }
18:
19: protected function unlinkPlan()
20: {
21: return $this->handler->unlinkPlan($this->side, $this->query);
22: }
23:
24: protected function getSides($opposing)
25: {
26: if ($this->side->type() === 'item')
27: return array($this->query, $opposing);
28:
29: return array($opposing, $this->query);
30: }
31:
32: }
33: