Get Subnodes sorted by priority.

@return \Doctrine\Common\Collections\ArrayCollection Subnodes
482870
public function getSubnodes()
    {
        $sort = \Doctrine\Common\Collections\Criteria::create();
        $sort->orderBy([
            'priority' => \Doctrine\Common\Collections\Criteria::DESC,
        ]);

        return $this
            ->subnodes
            ->matching($sort);
    }
924793
public function sort(): array
    {
        $items = array_values($this->keys);

        $this->states = $this->stack = [];
        foreach ($items as $item) {
            $this->dfs($item, $this->dependencies[$item]);
        }

        return $this->stack;
    }
1136347
public function getCommitOrder()
    {
        // Check whether we need to do anything. 0 or 1 node is easy.
        $nodeCount = count($this->classes);
        if ($nodeCount === 0) {
            return array();
        }

        if ($nodeCount === 1) {
            return array_values($this->classes);
        }
        
        // Init
        foreach ($this->classes as $node) {
            $this->nodeStates[$node->name] = self::NOT_VISITED;
        }
        
        // Go
        foreach ($this->classes as $node) {
            if ($this->nodeStates[$node->name] == self::NOT_VISITED) {
                $this->visitNode($node);
            }
        }

        $sorted = array_reverse($this->sorted);

        $this->sorted = $this->nodeStates = array();

        return $sorted;
    }
168872
public function getChildren()
    {
        $children = [];
        $notifications = $this->caldavBackend->getNotificationsForPrincipal($this->principalUri);

        foreach ($notifications as $notification) {
            $children[] = new Node(
                $this->caldavBackend,
                $this->principalUri,
                $notification
            );
        }

        return $children;
    }
850489
public function sortedSet(): self
    {
        $obj = clone $this;
        usort($obj->_elements,
            function (Element $a, Element $b) {
                if ($a->typeClass() != $b->typeClass()) {
                    return $a->typeClass() < $b->typeClass() ? -1 : 1;
                }
                if ($a->tag() == $b->tag()) {
                    return 0;
                }
                return $a->tag() < $b->tag() ? -1 : 1;
            });
        return $obj;
    }
131620
public function getOrderedItems()
    {
        if (config('menus.ordering') || $this->ordering) {
            return $this->toCollection()->sortBy(function ($item) {
                return $item->order;
            })->all();
        }

        return $this->items;
    }
1244479
protected function sortNodesByIndex(array $nodes)
    {
        usort($nodes, function (NodeData $node1, NodeData $node2) {
            if ($node1->getIndex() < $node2->getIndex()) {
                return -1;
            } elseif ($node1->getIndex() > $node2->getIndex()) {
                return 1;
            } else {
                return strcmp($node1->getIdentifier(), $node2->getIdentifier());
            }
        });

        return $nodes;
    }
1235306
public function getRequestedNodes()
    {
        $dh = $this->getSitemapDataProvider();
        if ($this->cookieJar->has('ConcreteSitemap-expand')) {
            $openNodeArray = explode(',', str_replace('_', '', $this->cookieJar->get('ConcreteSitemap-expand')));
            if (is_array($openNodeArray)) {
                $dh->setExpandedNodes($openNodeArray);
            }
        }
        if (!$this->includeMenuInResponse()) {
            if ($this->request->query->get('reloadSelfNode')) {
                $nodes = [$dh->getNode($this->request->query->get('cID'))];
            } else {
                $nodes = $dh->getSubNodes($this->request->query->get('cParentID'));
            }
        } else {
            $nodes = $dh->getSubNodes($this->getRequestedSiteTree());
        }

        return $nodes;
    }
214341
public function getSortedQuestions()
    {
        $criteria = Criteria::create();
        $criteria->orderBy(array('rank' => 'ASC'));

        return $this->getQuestions()->matching($criteria);
    }
986926
public function getChildren()
    {
        $nodes = [];
        try {
            $child = $this->firstChild();
            do {
                $nodes[] = $child;
                $child   = $this->nextChild($child->id());
            } while ( ! is_null($child));
        } catch (ChildNotFoundException $e) {
            // we are done looking for children
        }

        return $nodes;
    }
314582
public function getChildren()
    {
        $children = new ArrayCollection();
        if ($this->reference) {
            $children->add($this->reference);
        }

        return $children;
    }
201823
public static function getTree()
    {
        $menu = MenuItem::orderBy('lft')->get();

        if ($menu->count())
        {
            foreach ($menu as $k => $menu_item) {
                $menu_item->children = collect([]);

                foreach ($menu as $i => $menu_subitem) {
                    if ($menu_subitem->parent_id == $menu_item->id) {
                        $menu_item->children->push($menu_subitem);

                        // remove the subitem for the first level
                        $menu = $menu->reject(function ($item) use ($menu_subitem) {
                            return $item->id == $menu_subitem->id;
                        });
                    }
                }
            }
        }

        return $menu;
    }
260968
public function siblings()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        return $this->createSubCrawler($this->sibling($this->getNode(0)->parentNode->firstChild));
    }
354222
public function sortableConcreteData()
    {
        $list = [];
        foreach ($this as $index => $value) {
            $list[$index] = $value;
        }
        return $list;
    }
485540
public function getDescendants()
    {
        $descendants = [];
        if ($this->hasChildren()) {
            foreach ($this->getChildren() as $child) {
                $childDescendants = $child->hasChildren() ? $child->getDescendants() : [];
                $descendants = ArrayUtils::merge($descendants, ArrayUtils::merge([$child], $childDescendants));
            }
        }
        return $descendants;
    }
918440
protected function getClonedNodes()
    {
        $cloned_nodes = array();

        foreach ($this->nodes as $node) {
            $cloned_node = $node->cloneNode(true);

            if ($cloned_node instanceof \DOMElement && $cloned_node->hasAttribute('dqn_tmp_id')) {
                $cloned_node->removeAttribute('dqn_tmp_id');
            }

            $cloned_nodes[] = $cloned_node;
        }

        return $cloned_nodes;
    }
154247
public function getNodes()
    {
        $nodes = [];
        $data = $this->getState();

        foreach ($data['nodes'] as $id => $name) {
            $nodes[] = new Node($id, $this->getClient());
        }

        return $nodes;
    }