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.
960095
protected function getChildrenList()
    {
        $query = (new Query)
            ->select(['name', 'parents'])
            ->from($this->itemCollection);
        $children = [];
        foreach ($query->all($this->db) as $row) {
            if (!empty($row['parents'])) {
                foreach ($row['parents'] as $name) {
                    $children[$name][] = $row['name'];
                }
            }
        }
        return $children;
    }
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());
    }
655268
protected function getAll(){
		$em = $this->getEntityManager();
		$entityClass = $this->getEntityClass();
		
		if(empty($this->getParentControllerOptions())){
			$items = $em->getRepository($entityClass)->findAll();
		} else {
			$parentId = $this->getEvent()->getRouteMatch()->getParam($this->getParentControllerOptions()->getIdParamName());
			$items = $em->getRepository($entityClass)->findBy(array($this->getOptions()->getParentAttributeName() => $parentId));
		}
		
		return $items;
	}
284150
public function getMessages()
    {
        $messages = parent::getMessages();

        foreach ($this->children as $child) {
            $messages = array_merge($messages, $child->getMessages());
        }

        return $messages;
    }
456887
private function getAllChildRoleIds($parentIds)
    {
        $allChildIds = [];

        while (count($parentIds) > 0) {
            $parentIds = $this->getChildIds($parentIds);
            $allChildIds = ArrayHelper::merge($allChildIds, $parentIds);
        };

        return $allChildIds;
    }
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);
    }
742239
function getAllParents() {
    $result = array($this->getName() => $this);
    foreach ($this->getParents() as $parent) {
      $result += $parent->getAllParents();
    }
    return $result;
  }
944221
public function get_all_children_ids() {
        $children = [];
        $walk = [$this->id];
        while (count($walk) > 0) {
            $catid = array_pop($walk);
            $directchildren = self::get_tree($catid);
            if ($directchildren !== false && count($directchildren) > 0) {
                $walk = array_merge($walk, $directchildren);
                $children = array_merge($children, $directchildren);
            }
        }

        return $children;
    }
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");
         
    }
283411
public function getAllChildren() {
    // Define as array.
    $options = [];

    // Fetch main categories.
    foreach (array_keys($this->getCategories()) as $category) {
      $options = array_merge($options, $this->getChildren($category));
    }
    // Return array.
    return $options;
  }
1287615
public function getAllParents()
    {
        $closestParents = $this->getParents();

        $allParents = [];

        foreach ($closestParents as $parent) {
            $allParents = array_merge(
                $allParents,
                $parent->getAllParents()
            );
        }

        $allParents = array_unique(
            array_merge(
                $allParents,
                $closestParents->toArray()
            )
        );

        return $allParents;
    }
1016866
public function parents(): array
    {
        if (!$this->_parent) {
            return array();
        }
        $nodes = $this->_parent->parents();
        $nodes[] = $this->_parent;
        return array_reverse($nodes);
    }
11534
public function getComponents()
    {
        $result = [];

        foreach ($this->children as $childGroup) {
            foreach ($childGroup as $child) {
                if ($child instanceof self) {
                    $result[] = $child;
                }
            }
        }

        return $result;
    }
402156
public function getTopChildren()
    {
        if (is_null($this->topMenuItems)) {
            $this->topMenuItems = [];
            foreach ($this->adaptors as $menuAdaptor) {
                $menuAdaptor->adaptChildren($this, $this->topMenuItems, null, $this->getRequest());
            }
        }

        return $this->topMenuItems;
    }
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;
    }
456281
public function getAllParentRoles()
    {
        $reducer = function (array $result, Role $role) {
            $result[$role->getIdentifier()] = $role;
            return array_merge($result, $role->getAllParentRoles());
        };

        return array_reduce($this->parentRoles, $reducer, []);
    }
763420
public function getAll()
    {
        $all = parent::getAll();
        $res = [];
        foreach ($all as $key => $raw) {
            $res[$key] = $raw['value'];
        }

        return $res;
    }