| @@ 146-159 (lines=14) @@ | ||
| 143 | } |
|
| 144 | } |
|
| 145 | ||
| 146 | public function numberOfRealtionTo(string $entityToReach) |
|
| 147 | { |
|
| 148 | $numberOfRealtionTo = 0; |
|
| 149 | ||
| 150 | foreach ($this->map as $rootEntity => $meta) { |
|
| 151 | foreach ($meta['relations'] as $name => $entity) { |
|
| 152 | if ($entity == $entityToReach) { |
|
| 153 | $numberOfRealtionTo++; |
|
| 154 | } |
|
| 155 | } |
|
| 156 | } |
|
| 157 | ||
| 158 | return $numberOfRealtionTo; |
|
| 159 | } |
|
| 160 | ||
| 161 | public function listOfParentsOf(string $entityToReach) |
|
| 162 | { |
|
| @@ 161-174 (lines=14) @@ | ||
| 158 | return $numberOfRealtionTo; |
|
| 159 | } |
|
| 160 | ||
| 161 | public function listOfParentsOf(string $entityToReach) |
|
| 162 | { |
|
| 163 | $parents = []; |
|
| 164 | ||
| 165 | foreach ($this->map as $rootEntity => $meta) { |
|
| 166 | foreach ($meta['relations'] as $name => $entity) { |
|
| 167 | if ($entity == $entityToReach) { |
|
| 168 | $parents[] = $rootEntity; |
|
| 169 | } |
|
| 170 | } |
|
| 171 | } |
|
| 172 | ||
| 173 | return $parents; |
|
| 174 | } |
|
| 175 | ||
| 176 | public function getEntitiesPath() |
|
| 177 | { |
|