1: <?php
2:
3: namespace PHPixie\ORM\Relationships\Type\ManyToMany;
4:
5: 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 === 'left')
15: return $this->config->rightModel;
16:
17: return $this->config->leftModel;
18: }
19:
20: public function propertyName()
21: {
22: if ($this->type === 'left')
23: return $this->config->rightProperty;
24:
25: return $this->config->leftProperty;
26: }
27:
28: public function relationshipType()
29: {
30: return 'manyToMany';
31: }
32:
33: public function relatedModelName()
34: {
35: if ($this->type === 'left')
36: return $this->config->leftModel;
37:
38: return $this->config->rightModel;
39: }
40:
41: public function isDeleteHandled()
42: {
43: return true;
44: }
45:
46: }