Returns the children for every parent.
@return array the children list. Each array key is a parent item name,
and the corresponding array value is a list of child item names.
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;
    }
201738
public function getChildren()
    {
        $driveLocator = "/drives/{$this->parentReference->driveId}";
        $itemLocator  = "/items/{$this->id}";
        $endpoint     = "$driveLocator$itemLocator/children";

        $response = $this
            ->graph
            ->createCollectionRequest('GET', $endpoint)
            ->execute();

        $status = $response->getStatus();

        if ($status != 200) {
            throw new \Exception("Unexpected status code produced by 'GET $endpoint': $status");
        }

        $driveItems = $response->getResponseAsObject(DriveItem::class);

        if (!is_array($driveItems)) {
            return [];
        }

        return array_map(function (DriveItem $driveItem) {
            return new self($this->graph, $driveItem);
        }, $driveItems);
    }
970352
public static function getAllByParentGrouped()
    {
        $roles = false;
        if (method_exists(user(), 'roles') && method_exists(user(), 'getRolesList')) {
            $roles = true;
        }

        $builder = self::where('is_hidden', 0);

        // if roles are defined on user
        if ($roles) {
            $roles = user()->getRolesList();
            $builder->whereHas('roles', function ($query) use ($roles) {
                return $query->whereIn('roles.id', $roles);
            });
        }

        $items = $builder->orderBy('list_order')
            ->select('id', 'title', 'slug', 'url', 'icon', 'parent_id')
            ->get()
            ->groupBy('parent_id');

        if (count($items)) {
            $items['root'] = collect();
            if (isset($items[''])) {
                $items['root'] = $items[''];
                unset($items['']);
            }
            if (isset($items[0])) {
                $items['root'] = $items[0];
                unset($items[0]);
            }
        }

        return $items;
    }
294720
public function get_child_ids() {
        $childids = array();
        foreach ($this->items as $child) {
           $childids[] = $child->id;
        }
        return $childids;
    }
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);
    }
368640
public function children()
    {
        if (!$this->nodes) {
            throw new \InvalidArgumentException('The current node list is empty.');
        }

        $node = $this->getNode(0)->firstChild;

        return $this->createSubCrawler($node ? $this->sibling($node) : array());
    }
428832
public  function getParents(){
         $class = get_called_class();
         $meta = $class::getMetadata(); 
         $path = $this->{$meta['pathfield']};
         $ap = str_split($path,8);
         array_pop($ap);
         if(count($ap)==0){
             return array();
         }
         $ids = implode(",",$ap) ;
         $where = $meta["keyfield"] . " in (".$ids.")";    
         return self::find($where,$meta["keyfield"] . " desc");
         
    }
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");
    }
61351
public function children()
    {
        return $this->menu->items->filter(function ($item) {
            return $item->hasParent() && $item->parent->name == $this->name;
        });
    }
260704
public function getChildren()
    {
        if (isset($this->relations['children'])) {
            return $this->relations['children'];
        }

        $children = $this->getAttribute('children');

        return $children === null ? [] : $children;
    }
915824
public function getTopChildren()
    {
        $result = [];
        $children = $this->getChildren();
        foreach ($children as $child) {
            if ($child instanceof TopMenuItem) {
                $result[] = $child;
            }
        }

        return $result;
    }
958756
public function getChilds()
    {
        if (config('menus.ordering')) {
            return collect($this->childs)->sortBy(function ($child) {
                return $child->order;
            })->all();
        }

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

        $node = $this->getNode(0);
        $nodes = array();

        while ($node = $node->parentNode) {
            if (XML_ELEMENT_NODE === $node->nodeType) {
                $nodes[] = $node;
            }
        }

        return $this->createSubCrawler($nodes);
    }
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');
    }
924848
public function get_children() {
        $children = array();

        if ($child = $this->get_area_user_private(0, '/', '.')) {
            $children[] = $child;
        }
/*
        if ($child = $this->get_area_user_profile(0, '/', '.')) {
            $children[] = $child;
        }
*/
        if ($child = $this->get_area_user_backup(0, '/', '.')) {
            $children[] = $child;
        }
        // do not list draft area here - it is browsable only if you know the draft itemid ;-)

        return $children;
    }
837904
public function get_items() {
        if (!isset($this->data[Parser::INDEX_CHILDREN_SPEC])) {
            return array();
        }

        $items = array();
        foreach ($this->data[Parser::INDEX_CHILDREN_SPEC] as $k => $data) {
            $items[] = $this->api->get_item($data['value']);
        }
        
        return $items;
    }
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;
    }