@@ 272-284 (lines=13) @@ | ||
269 | * |
|
270 | * @return null|int Parent entity identifier |
|
271 | */ |
|
272 | public function entityParent($entityID) |
|
273 | { |
|
274 | $parentData = $this->database->fetch(' |
|
275 | SELECT * |
|
276 | FROM structure_relation as sm |
|
277 | JOIN structure as s ON s.StructureID = sm.parent_id |
|
278 | WHERE sm.child_id = "' . $entityID . '" |
|
279 | AND s.StructureID != "' . $entityID . '" |
|
280 | '); |
|
281 | ||
282 | // Get parent entity identifier |
|
283 | return count($parentData) ? $parentData[0]['StructureID'] : null; |
|
284 | } |
|
285 | ||
286 | /** @return array Collection of navigation additional fields */ |
|
287 | protected function navigationFields($navigationID) |
@@ 272-284 (lines=13) @@ | ||
269 | * |
|
270 | * @return null|int Parent entity identifier |
|
271 | */ |
|
272 | public function entityParent($entityID) |
|
273 | { |
|
274 | $parentData = $this->database->fetch(' |
|
275 | SELECT * |
|
276 | FROM structure_relation as sm |
|
277 | JOIN structure as s ON s.StructureID = sm.parent_id |
|
278 | WHERE sm.child_id = "' . $entityID . '" |
|
279 | AND s.StructureID != "' . $entityID . '" |
|
280 | '); |
|
281 | ||
282 | // Get parent entity identifier |
|
283 | return count($parentData) ? $parentData[0]['StructureID'] : null; |
|
284 | } |
|
285 | ||
286 | /** @return array Collection of navigation additional fields */ |
|
287 | protected function navigationFields($navigationID) |