mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-07-01 14:05:07 +03:00
Fixes for _GetDescendantsOfEntity and _GetAncestorsOfEntity
This commit is contained in:
parent
4fc990a06a
commit
d21dacda65
|
@ -141,11 +141,10 @@ abstract class ModuleORM extends Module {
|
|||
$aAncestors=$aRelationsData['ancestors'];
|
||||
} else {
|
||||
$aAncestors=array();
|
||||
$sParentId=$oEntity->getParentId();
|
||||
while($sParentId > 0) {
|
||||
$oEntity=$oEntity->getParent();
|
||||
$aAncestors[]=$oEntity;
|
||||
$sParentId=$oEntity->getParentId();
|
||||
$oEntityParent=$oEntity->getParent();
|
||||
while(is_object($oEntityParent)) {
|
||||
$aAncestors[]=$oEntityParent;
|
||||
$oEntityParent=$oEntityParent->getParent();
|
||||
}
|
||||
}
|
||||
if(is_array($aAncestors)) {
|
||||
|
@ -165,7 +164,6 @@ abstract class ModuleORM extends Module {
|
|||
} else {
|
||||
$aDescendants=array();
|
||||
if($aChildren=$oEntity->getChildren()) {
|
||||
$aDescendants=$aChildren;
|
||||
$aTree=self::buildTree($aChildren);
|
||||
foreach($aTree as $aItem) {
|
||||
$aDescendants[] = $aItem['entity'];
|
||||
|
|
Loading…
Reference in a new issue