Get children nodes.

@param string $dsId  ds_id of node to fetch children
@param int    $level (Optional) recursion depth

@return ElementtypeStructureNode[]
424355
public function getChildNodes($dsId, $level = 1)
    {
        $children = [];

        $childrenDsIds = $this->getChildrenDsIds($dsId, $level);
        foreach ($childrenDsIds as $childDsId) {
            $children[] = $this->getNode($childDsId);
        }

        return $children;
    }
1183487
public function GetAllChildrenIds()
    {
        $aChildIdList = $this->GetFromInternalCache('aChildIdList');
        if (null !== $aChildIdList) {
            return $aChildIdList;
        }
        $aChildIdList = array();
        $oChildren = &$this->GetChildren();
        while ($oChild = &$oChildren->Next()) {
            $aChildIdList[] = $oChild->id;
            $aChildChildIdList = $oChild->GetAllChildrenIds();
            $aChildIdList = array_merge($aChildIdList, $aChildChildIdList);
        }
        $this->SetInternalCache('aChildIdList', $aChildIdList);

        return $aChildIdList;
    }
4792
public function getPaths(\DOMElement $nodeList, $level = 0)
    {
        $output = $nodeList->getNodePath();

        foreach ($nodeList->childNodes as $childObject) {
            $output .= $childObject->getNodePath() . "\n";

            if ($childObject instanceof \DOMElement) {
                $output .= $this->getElement($childObject, $level + 1, true);
            }
        }
        return $output;
    }
242470
public function getChildById($id)
	{
		if(isset($this->id2index[$id]))
			return $this->children[$this->id2index[$id]];
		return null;
	}
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;
    }
1183131
protected function _getLevelElement(array $options, $level)
    {
        $levelElement = 'menu_child_' . $level;
        $element      = $options['childMenuAttr']['element'];

        list($plugin, $path) = $this->_View->pluginSplit($element);
        $path    = FS::clean($path, '/');
        $details = explode('/', $path);
        array_pop($details);

        $path = implode('/', $details);

        return $plugin . '.' . $path . '/' . $levelElement;
    }
845924
public function getChild($id)
    {
        if (array_key_exists($id, $this->children_by_id)) {
            return $this->children_by_id[$id];
        } else {
            return null;
        }
    }
1108662
public function children($name = null)
    {
        if (!$name) {
            return $this->getStructures();
        }

        $result = [];
        foreach ($this->getStructures() as $childStructure) {
            if ($childStructure->getParentName() === $name) {
                $result[] = $childStructure;
            } else {
                $localResult = $childStructure->children($name);
                if ($localResult) {
                    $result = array_merge($result, $localResult);
                }
            }
        }

        if (!count($result)) {
            return null;
        }

        return $result;
    }
181552
public static function get_children_of_user($userid) {
        global $DB;

        // Get users that the user has role assignments to.
        $allusernames = get_all_user_name_fields(true, 'u');
        $sql = "SELECT u.id, $allusernames
                  FROM {role_assignments} ra, {context} c, {user} u
                 WHERE ra.userid = :userid
                       AND ra.contextid = c.id
                       AND c.instanceid = u.id
                       AND c.contextlevel = :contextlevel";
        $params = [
            'userid' => $userid,
            'contextlevel' => CONTEXT_USER
        ];

        // The final list of users that we will return.
        $finalresults = [];

        // Our prospective list of users.
        if ($candidates = $DB->get_records_sql($sql, $params)) {
            foreach ($candidates as $key => $child) {
                $childcontext = \context_user::instance($child->id);
                if (has_capability('tool/dataprivacy:makedatarequestsforchildren', $childcontext, $userid)) {
                    $finalresults[$key] = $child;
                }
            }
        }
        return $finalresults;
    }
818389
public function getTreeIds($includeSelf = true, $includeParents = false)
    {
        if ( $includeParents ) {
            return array_merge($this->getParentsId(), $this->getChildrenId($includeSelf));
        } else {
            return $this->getChildrenId($includeSelf);
        }
    }
941838
public function getTree( $level = \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE )
	{
		return $this->controller->getTree( $level );
	}
1283338
protected function getChildren($oid) {
    $permissionManager = $this->getPermissionManager();
    $persistenceFacade = $this->getPersistenceFacade();

    // check read permission on type
    $type = $oid->getType();
    if (!$permissionManager->authorize($type, '', PersistenceAction::READ)) {
      return [];
    }

    $objectsTmp = [];
    if ($this->isRootTypeNode($oid)) {
      // load instances of type
      $objectsTmp = $persistenceFacade->loadObjects($type, BuildDepth::SINGLE);
    }
    else {
      // load children of node
      if ($permissionManager->authorize($oid, '', PersistenceAction::READ)) {
        $node = $persistenceFacade->load($oid, 1);
        if ($node) {
          $objectsTmp = $node->getChildren();
        }
      }
    }

    // check read permission on instances
    $objects = [];
    foreach ($objectsTmp as $object) {
      if ($permissionManager->authorize($object->getOID(), '', PersistenceAction::READ)) {
        $objects[] = $object;
      }
    }

    return $objects;
  }
519856
public function getDescendants($depth = null)
    {
        if(!$this->hasChildren())
        {
            return array();
        }

        if($this->descendants === null)
        {
            $qb = $this->getManager()->getConfiguration()->getBaseQueryBuilder();
            $alias = $this->getManager()->getConfiguration()->getQueryBuilderAlias();

            $qb->andWhere("$alias.".$this->getLeftFieldName()." > :lft1")
                ->setParameter('lft1', $this->getLeftValue())
                ->andWhere("$alias.".$this->getRightFieldName()." < :rgt1")
                ->setParameter('rgt1', $this->getRightValue())
                ->orderBy("$alias.".$this->getLeftFieldName(), "ASC");
            if($this->hasManyRoots())
            {
                $qb->andWhere("$alias.".$this->getRootFieldName()." = :root")
                    ->setParameter('root', $this->getRootValue());
            }

            // TODO: Add depth support or self join support?
			$q = $qb->getQuery();
			if ($this->getManager()->getConfiguration()->isQueryHintSet()){
				$q = $this->getManager()->addHintToQuery($q);
			}
            $results = $q->getResult();

            $this->descendants = array();
            foreach($results as $result)
            {
                $this->descendants[] = $this->getManager()->wrapNode($result);
            }
        }

        if($depth !== null)
        {
            // TODO: Don't rebuild filtered array everytime?
            return $this->getManager()->filterNodeDepth($this->descendants, $depth);
        }

        return $this->descendants;
    }
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;
    }
1014224
public function getChildren($parentID)
    {
        $tmp = [];
        foreach($this->categoryList as $key => $item){
            if($item->parentID == $parentID) {
                $tmp[] = $item;
            }
        }

        return $tmp;
    }
279854
public function getChildren()
    {
        if ($this->disableListing) {
            throw new DAV\Exception\MethodNotAllowed('Listing members of this collection is disabled');
        }
        $children = [];
        foreach ($this->principalBackend->getPrincipalsByPrefix($this->principalPrefix) as $principalInfo) {
            $children[] = $this->getChildForPrincipal($principalInfo);
        }

        return $children;
    }
1369020
public function getChildById($id)
    {
        foreach ($this->children as $child) {
            if ($child->id === $id) {
                return $child;
            }

            $subChild = $child->getChildById($id);
            if ($subChild !== null) {
                return $subChild;
            }
        }

        return null;
    }