1 | <?php |
||
24 | trait RelationsUtilityMethods |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @var RepositoryInterface |
||
29 | */ |
||
30 | protected $parentRepository; |
||
31 | |||
32 | /** |
||
33 | * Gets the parent or related entity descriptor |
||
34 | * |
||
35 | * @return EntityDescriptorInterface |
||
36 | */ |
||
37 | abstract public function getParentEntityDescriptor(); |
||
38 | |||
39 | /** |
||
40 | * Gets parent entity class name |
||
41 | * |
||
42 | * @return string |
||
43 | */ |
||
44 | abstract public function getParentEntity(); |
||
45 | |||
46 | /** |
||
47 | * Gets the parent entity primary key field name |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | 8 | public function getParentPrimaryKey() |
|
57 | |||
58 | /** |
||
59 | * Gets parent entity repository |
||
60 | * |
||
61 | * @return \Slick\Orm\Repository\EntityRepository |
||
62 | */ |
||
63 | 12 | public function getParentRepository() |
|
72 | |||
73 | /** |
||
74 | * Sets parent entity repository |
||
75 | * |
||
76 | * @param RepositoryInterface $repository |
||
77 | * @return $this |
||
78 | */ |
||
79 | 12 | public function setParentRepository(RepositoryInterface $repository) |
|
84 | |||
85 | /** |
||
86 | * Gets the entity mapper of parent entity repository |
||
87 | * |
||
88 | * @return \Slick\Orm\EntityMapperInterface |
||
89 | */ |
||
90 | 8 | public function getParentEntityMapper() |
|
95 | |||
96 | /** |
||
97 | * Gets parent entity table name |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | 14 | public function getParentTableName() |
|
106 | |||
107 | /** |
||
108 | * Get parent entity fields collection |
||
109 | * |
||
110 | * @return FieldsCollection|FieldDescriptor[] |
||
111 | */ |
||
112 | 4 | public function getParentFields() |
|
117 | } |