1: <?php
2:
3: namespace PHPixie\ORM\Relationships\Type\OneTo;
4:
5: abstract class Side extends \PHPixie\ORM\Relationships\Relationship\Implementation\Side
6: implements \PHPixie\ORM\Relationships\Relationship\Side\Relationship,
7: \PHPixie\ORM\Relationships\Relationship\Side\Preload,
8: \PHPixie\ORM\Relationships\Relationship\Side\Property\Entity,
9: \PHPixie\ORM\Relationships\Relationship\Side\Property\Query,
10: \PHPixie\ORM\Relationships\Relationship\Side\Cascade\Delete
11: {
12: public function modelName()
13: {
14: if ($this->type === 'owner')
15: return $this->config->itemModel;
16:
17: return $this->config->ownerModel;
18: }
19:
20: public function propertyName()
21: {
22: if ($this->type === 'owner')
23: return $this->config->itemOwnerProperty;
24:
25: return $this->config->ownerProperty();
26: }
27:
28: public function relatedModelName()
29: {
30: if ($this->type === 'owner')
31: return $this->config->ownerModel;
32:
33: return $this->config->itemModel;
34: }
35:
36: public function isDeleteHandled()
37: {
38: return $this->type !== 'owner';
39: }
40: }
41: