Return all parent elements **without** the current item.

@return array An array with Item-Objects.
331119
public function getParents()
    {
        $parent = $this->with($this->_with)->getParent();
        $data = [];
        while ($parent) {
            $data[] = $parent;
            $parent = $parent->with($this->_with)->getParent();
        }

        return array_reverse($data);
    }
513241
public function filterParent()
    {
        $value = $this->parent_name;
        $parent = self::findOne(['name' => $value]);
        if ($parent) {
            $id = $this->id;
            $parent_id = $parent->id;
            while ($parent) {
                if ($parent->id == $id) {
                    $this->addError('parent_name', 'Loop detected.');

                    return;
                }
                $parent = $parent->menuParent;
            }
            $this->parent = $parent_id;
        }
    }
941029
public function findAll()
	{
		$a = [];
		foreach ($this->parents as $x => $r) {
			$a[$x] = $this->find($x);
		}
		return $a;
	}
258251
public function getParentList(){
        if(!$this->isPropertyAvailable('ParentList')){
            $this->setProperty("ParentList", new SPList($this->getContext(),new ResourcePathEntity($this->getContext(),$this->getResourcePath(), "parentlist")),false);
        }
        return $this->getProperty("ParentList");
    }
94904
private function getRootNodes()
    {
        $output = array();
        foreach( $this->nodes as $node )
            if (! $node->parentCount() )
                $output[] = $node;
        return $output;
    }
1278638
final public function parent()
    {
        $parent = NULL;

        if(!!isset($this->dom_element->parentNode))
        {
            if($this->dom_element->parentNode->nodeType == 1)
            {
                $parent = new PHPHtmlDomElement($this->dom_element->parentNode);
            }
            else
            {
                $parent = $this->dom_element->parentNode;
            }
        }
        return $parent;
    }
652501
public function getParentsList()
    {
        /** @var static $root */
        $root  = static::root();
        $items = [
            ['id' => '1', 'title' => 'Item Root'],
        ];

        if ($this->exists) {
            $parents = $this->ancestors()
                            ->withoutRoot()
                            ->orWhere(function ($query) {
                                $query->where('depth', $this->depth)->where('id', '<>', $this->id);
                            })
                            ->get();
            foreach ($parents as $parent) {
                $items[] = [
                    'title' => $parent->present()->indentedTitle(),
                    'id'    => $parent->id,
                ];
            }
        } else {
            foreach ($root->getDescendants() as $parent) {
                $items[] = [
                    'title' => $parent->present()->indentedTitle(),
                    'id'    => $parent->id,
                ];
            }
        }

        return array_pluck($items, 'title', 'id');
    }
885839
public function getParentDirectories()
    {
        if ($this->isCurrentDirectoryBase()) {
            return [];
        }

        $currentDir = $this->currentDir;
        $dirs = [];
        do {
            $dir = dirname($currentDir);
            $dirs[] = $this->getPathRelativeToBaseDir($dir)
                ?: DIRECTORY_SEPARATOR;
            $currentDir = $dir;
        } while ($dir !== $this->baseDir);

        return array_reverse($dirs);
    }
274979
public function getChildren(MenuItem $parent = null)
    {
        if ($parent === null) {
            return $this->getTopChildren();
        }
        /* @var $request Request */
        $request = $this->container->get('request_stack')->getCurrentRequest();
        $result = array();
        foreach ($this->getAdaptors() as $menuAdaptor) {
            $menuAdaptor->adaptChildren($this, $result, $parent, $request);
        }

        return $result;
    }
163230
protected function getChildrenList() {
        $query = (new Query)->from($this->itemChildTable);
        $parents = [];
        foreach ($query->all($this->db) as $row) {
            $parents[$row['parent']][] = $row['child'];
        }
        return $parents;
    }
730219
function getParentClass() {
		for ($i = $this->count() - 1; $i >= 0; $i --) {
			$item = $this->statements[$i];
			if ($item->type === "CLASS" || $item->type === "INTERFACE") {
				return $item;
			}
		}
		// In case of a empty stack, we are at the root of a PHP file (with no class or function).
		return $this->getDefaultItem();
	}
1275539
private function determineParentsOfValues()
    {
        $parents     = [];
        $environment = $this->getEnvironment();
        $mode        = $environment->getDataDefinition()->getBasicDefinition()->getMode();
        if (BasicDefinitionInterface::MODE_HIERARCHICAL !== $mode) {
            return [];
        }

        foreach ((array) $this->varValue as $value) {
            $dataDriver = $environment->getDataProvider();
            $this->parentsOf($dataDriver->fetch($dataDriver->getEmptyConfig()->setId($value)), $parents);
        }

        return $parents;
    }
612680
public function getParentList()
    {
        if (null === $this->parentList) {
            $this->parentList = [];

            $parent = $this->getDescriptor()->getParent();

            for ($index = 1; null !== $parent; $index++) {
                $this->parentList[$parent->getName() . '-'] = $parent;

                $parent = $parent->getDescriptor()->getParent();
            }
        }

        return $this->parentList;
    }
856523
public function getTreeNodeParentArray()
    {
        $db = Database::connection();
        $nodeArray = [];
        $currentNodeParentID = $this->getTreeNodeParentID();
        if ($currentNodeParentID > 0) {
            while (is_numeric($currentNodeParentID) && $currentNodeParentID > 0 && $currentNodeParentID) {
                $row = $db->fetchAssoc('select treeNodeID, treeNodeParentID from TreeNodes where treeNodeID = ?', [$currentNodeParentID]);
                if ($row && $row['treeNodeID']) {
                    $nodeArray[] = self::getByID($row['treeNodeID']);
                }

                $currentNodeParentID = $row['treeNodeParentID']; // moving up the tree until we hit 1
            }
        }

        return $nodeArray;
    }
870600
public function getBreadcrumbItems()
    {
        $item = $this->getBaseItem();
        $items = array();

        while ($current = $item->getCurrentChild())
        {
            $items[] = $current;

            $item = $current;
        }

        return $items;
    }
1249670
private function getDeletionPreventingParents() {
        $parentEntities = array();
        foreach($this->getModelBuilder()->getRelationships() as $relationship) {
            if($relationship->isPlural() && !$relationship->isNullable() && $relationship->getAction() != 'ACTION_CASCADE') {
                $parentEntities[] = $relationship->getAlias();
            }
        }

        return $parentEntities;
    }
46878
public function doSort()
    {
        $this->sorted = array();

        foreach ($this->elements as $element) {
            $parents = array();
            $this->visit($element, $parents);
        }

        return $this->sorted;
    }