1
0
Fork 0
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:
Alexander Zinchuk 2010-11-09 01:48:36 +00:00
parent 4fc990a06a
commit d21dacda65

View file

@ -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'];