@@ 131-144 (lines=14) @@ | ||
128 | } |
|
129 | } |
|
130 | ||
131 | public function numberOfRealtionTo(string $entityToReach) |
|
132 | { |
|
133 | $numberOfRealtionTo = 0; |
|
134 | ||
135 | foreach ($this->map as $rootEntity => $meta) { |
|
136 | foreach ($meta['relations'] as $name => $entity) { |
|
137 | if ($entity == $entityToReach) { |
|
138 | $numberOfRealtionTo++; |
|
139 | } |
|
140 | } |
|
141 | } |
|
142 | ||
143 | return $numberOfRealtionTo; |
|
144 | } |
|
145 | ||
146 | public function listOfParentsOf(string $entityToReach) |
|
147 | { |
|
@@ 146-159 (lines=14) @@ | ||
143 | return $numberOfRealtionTo; |
|
144 | } |
|
145 | ||
146 | public function listOfParentsOf(string $entityToReach) |
|
147 | { |
|
148 | $parents = []; |
|
149 | ||
150 | foreach ($this->map as $rootEntity => $meta) { |
|
151 | foreach ($meta['relations'] as $name => $entity) { |
|
152 | if ($entity == $entityToReach) { |
|
153 | $parents[] = $rootEntity; |
|
154 | } |
|
155 | } |
|
156 | } |
|
157 | ||
158 | return $parents; |
|
159 | } |
|
160 | ||
161 | public function getEntitiesPath() |
|
162 | { |