Return all the parents of this class in a set ordered from the closest to furtherest parent.

@param bool $includeSelf
@return ArrayList
424492
public function getAncestors($includeSelf = false)
    {
        $ancestors = new ArrayList();
        $object = $this->owner;

        if ($includeSelf) {
            $ancestors->push($object);
        }
        while ($object = $object->getParent()) {
            $ancestors->push($object);
        }

        return $ancestors;
    }
1082572
public function getIndexes( $includeParents = true )
    {

        // lazy load indexes
        if( !isset( $this->indexes ) ) {

            $this->indexes = $this->catalog->pgIndexes->findByIndrelid( $this->oid );

            // are we inheriting off another table
            if( $parent = $this->getParent() ) {

                foreach( $parent->getIndexes() as $parentIndex ) {

                    $data = $parentIndex->all();
                    $data['inherited'] = true;
                    $data['columns'] = [];

                    foreach( $parentIndex->indkey as $indkey ) {
                        $columns[] = sprintf( "%s.%s", $this->oid, $indkey );
                    }

                    $this->indexes->add(
                        new PgIndex( $this->catalog, $data )
                    );

                }

            }

        }

        // include parent indexes
        if( $includeParents ) {
            return $this->indexes->copy();
        } else {
            return $this->indexes->copy()->removeByInherited( true );
        }

    }
193399
protected function getIncluded(ElementInterface $element, $includeParent = false)
    {
        $included = [];

        foreach ($element->getResources() as $resource) {
            if ($resource->isIdentifier()) {
                continue;
            }

            if ($includeParent) {
                $included = $this->mergeResource($included, $resource);
            } else {
                $type = $resource->getType();
                $id = $resource->getId();
            }

            foreach ($resource->getUnfilteredRelationships() as $relationship) {
                $includedElement = $relationship->getData();

                if (! $includedElement instanceof ElementInterface) {
                    continue;
                }

                foreach ($this->getIncluded($includedElement, true) as $child) {
                    // If this resource is the same as the top-level "data"
                    // resource, then we don't want it to show up again in the
                    // "included" array.
                    if (! $includeParent && $child->getType() === $type && $child->getId() === $id) {
                        continue;
                    }

                    $included = $this->mergeResource($included, $child);
                }
            }
        }

        $flattened = [];

        array_walk_recursive($included, function ($a) use (&$flattened) {
            $flattened[] = $a;
        });

        return $flattened;
    }
703110
public static function getAncestors($source,$idField,$pidField,$fieldValue,$includeSelf=true)
    {
        $returnValue=[];
        $current=null;
        foreach($source as $row){
            $idValue=Convert::getFieldValue($row, $idField,true);
            if($idValue==$fieldValue){
                $current=$row;
                if($includeSelf){
                    $returnValue[]=$current;
                }
                break;
            }
        }
        $pidValue=Convert::getFieldValue($current, $pidField,true);
        while($pidValue){
            $current=self::_getAncestors($source,$idField,$pidValue);
            if(!empty($current)){
                $returnValue[]=$current;
                $pidValue=Convert::getFieldValue($current, $pidField,true);
            }else{
                break;
            }
        }

        //echo $returnValue[1][$idField];
        return array_reverse($returnValue);
    }
1294749
public function getParents($id, $ordering = 'ASC')
    {
        if ($parents = $this->qb
            ->select($this->table . '.*')
            ->from($this->table)
            ->from($this->table . ' AS node')
            ->whereBetween('node.record_left', [$this->table . '.record_left', $this->table . '.record_right'])
            ->where([
                'node.id' => $id,
            ])
            ->orderBy($this->table . '.record_left', $ordering)
            ->get()) {
            if ($parents->count()) {
                return $parents;
            }
        }

        return false;
    }
891784
public function getParentsList()
    {
        /** @var static $root */
        $root  = static::root();
        $items = [
            ['id' => '1', 'title' => 'Item Root'],
        ];
        $nodes = $root->descendants();
        if ($this->exists) {
            $nodes->where('navigation_id', $this->navigation_id)->where('id', '<>', $this->id);
        }

        foreach ($nodes->get() as $node) {
            foreach ($node->getDescendantsAndSelf()->toHierarchy() as $menu) {
                $this->appendMenu($menu, $items);
            }
        }

        return array_pluck($items, 'title', 'id');
    }
1062001
public function parents($current = false)
    {
        $instances = [];
        $instance  = $current ? $this : $this->_parent;

        while ($instance !== null) {
            $instances[] = $instance;
            $instance = $instance->_parent;
        }
        return array_reverse($instances);
    }
264777
public function getLists()
    {
        $returnValue = array();

        
        
        $returnValue[] = new core_kernel_classes_Class(GenerisRdf::GENERIS_BOOLEAN);
        
        foreach($this->parentListClass->getSubClasses(false) as $list){
        	$returnValue[] = $list;
        }
        
        
        
        

        return (array) $returnValue;
    }
606815
public function getParentsForBreadcrumbs(
    $entity,
        &$parents = []
    )
    {
        array_push($parents, $entity);
        if ($entity->parent !== null) {
            $this->getParentsForBreadcrumbs($entity->parent, $parents);
        }
        return array_reverse($parents);
    }
1061406
protected function getParentsHierarchyField($dataObject) {
		
		// see if we've got Parent values
		if (is_object($dataObject) && method_exists($dataObject, 'hasField') && $dataObject->hasField('ParentID')) {
			$parentsField = array('Type' => '', 'Value' => null);
			$parents = array();
			
			$parent = $dataObject;
			while ($parent && $parent->ParentID) {
				$parents[] = $parent->ParentID;
				$parent = $parent->Parent();
				// fix for odd behaviour - in some instance a node is being assigned as its own parent. 
				if ($parent->ParentID == $parent->ID) {
					$parent = null;
				}
			}
			$parentsField['Value'] = $parents;
			return $parentsField;
		}
	}
272486
public function findDescendants($parent, $draft = true)
    {
        $this->setDraftVersionFilter(! $draft);
        
        $iterator = new \RecursiveIteratorIterator(
            new RecursiveBlockIterator([$parent]),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        $blocks = [];
        foreach ($iterator as $descendant) {
            $blocks[] = $descendant;
        }

        if ($draft) {
            $this->revertToDraft($blocks);
        }

        return $blocks;
    }
879684
public function getBlockColumns($includeParent = true)
    {
        // load columns if they haven't been loaded yet
        if ($this->blockColumns === null) {
            $this->loadBlockColumns();

        }
        $blockColumns = $this->blockColumns;


        // also load parent(s) columns if requested
        if ($includeParent) {
            $parentModel = $this->getParentModel(true);
            if ($parentModel) {
                /** @var BaseModel $parentModel */
                $parentModel = new $parentModel();
                $parentColumns = $parentModel->getBlockColumns(true);

                // the parent model may return null, let's catch and change to an empty array
                // thus indicating that block columns have been "loaded" even if they are blank
                if ($parentColumns == null) {
                    $parentColumns = [];
                }
                $blockColumns = array_unique(array_merge($blockColumns, $parentColumns));
            }
        }

        // return block columns
        return $blockColumns;
    }
1041338
protected function getParentsHierarchyField() {
		// see if we've got Parent values
        $parents = array();

        $parent = $this->owner;
        while ($parent && $parent->ParentID) {
            $parents[] = (int) $parent->ParentID;
            $parent = $parent->Parent();
            // fix for odd behaviour - in some instance a node is being assigned as its own parent. 
            if ($parent->ParentID == $parent->ID) {
                $parent = null;
            }
        }
        return $parents;
	}
463968
public function listCollections($includeSystemCollections = false)
    {
        $this->time->start();
        $return = parent::listCollections($includeSystemCollections);
        $time = $this->time->stop();

        $this->log(array(
            'type' => 'listCollections',
            'time' => $time,
        ));

        return $return;
    }
1337960
public function findChildrenByParentId($parent_id)
    {
        $qb = $this->createQueryBuilder();
        $qb->andWhere($qb->getRootAliases()[0] . '.parent = ' . $this->addNamedParameter('parent', $parent_id, $qb))
            ->orderBy($qb->getRootAliases()[0] . '.position', 'ASC');
        return $qb->getQuery()->getResult();
    }
964417
public function getParent(array $context)
    {
        if (null !== $this->parent) {
            return $this->parent;
        }

        $parent = $this->doGetParent($context);
        if (false === $parent) {
            return false;
        } elseif ($parent instanceof Twig_Template) {
            $name = $parent->getTemplateName();
            $this->parents[$name] = $parent;
            $parent = $name;
        } elseif (!isset($this->parents[$parent])) {
            $this->parents[$parent] = $this->env->loadTemplate($parent);
        }

        return $this->parents[$parent];
    }
956903
public function getChildren($includeHiddenFromNav = true)
    {
        if (is_null($this->children)) {
            $children = $this->menu->getChildren($this->node, true);
            /* @var NodeMenuItem $child */
            foreach ($children as $child) {
                $child->setParent($this);
            }
            $this->children = $children;
        }

        $children = array_filter($this->children, function (NodeMenuItem $entry) use ($includeHiddenFromNav) {
            if ($entry->getNode()->isHiddenFromNav() && !$includeHiddenFromNav) {
                return false;
            }

            return true;
        });

        return $children;
    }