Returns all of the children for the CMS Tree.
Filters to only those groups that the current user can edit

@return ArrayList
191171
public function AllChildrenIncludingDeleted()
    {
        $children = parent::AllChildrenIncludingDeleted();

        $filteredChildren = new ArrayList();

        if ($children) {
            foreach ($children as $child) {
                /** @var DataObject $child */
                if ($child->canView()) {
                    $filteredChildren->push($child);
                }
            }
        }

        return $filteredChildren;
    }
1024716
public function getAllChildren($parent_id = null)
    {
        $parent_id = $parent_id ?? $this->id;
        $children = $this::find()->where(['parent_id' => $parent_id])->all();
        return $children;
    }
314582
public function getChildren()
    {
        $children = new ArrayCollection();
        if ($this->reference) {
            $children->add($this->reference);
        }

        return $children;
    }
585182
public function Children()
    {
        $now = SS_DateTime::now()->Format('Y-m-d');

        return $this->Newsitems()
            ->filter(array('Live' => true))
            ->exclude(array('PublishFrom:GreaterThan' => $now));
    }
419598
public ViewNode[] findChildren() {
		synchronized (children) {
			ViewNode results[] = new ViewNode[children.size()];
			return ((ViewNode[]) children.toArray(results));
		}
	}
421100
public function getExcludedSiteTreeClassNames() {
		$classes = array();
		$siteTreeClasses = $this->owner->allowedChildren();
		foreach($siteTreeClasses as $class) {
			if(Injector::inst()->create($class)->config()->show_in_sitetree === false) {
				$classes[$class] = $class;
			}
		}
		return $classes;
	}
504872
public function children()
    {
        if ($this->collection === null) {
            $this->initializeCollection($this->defaultChildren());
        }

        return $this->collection;
    }
164426
public function getAllSpContainers()
	{
		$allSpContainers = array();

		foreach ($this->_children as $child) {
			if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
				$allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers());
			} else {
				$allSpContainers[] = $child;
			}
		}

		return $allSpContainers;
	}
382428
public function getChildren()
    {
		if (!$this->_children)
		{
			if ($this->getParam('iterator')) {
				$this->_children = $this->getParam('iterator');
			}
			else {
				try {
					$this->_children = $this->getCatalog()->getMaterials();
                    if ($this->getParam('order')) {
                        $this->_children->orderBy($this->getParam('order'), $this->getParam('sort'));
                    }
                    $this->_children->orderBy('id', 'ASC', true);
					if ($this->getParam('subfolders') || $this->getParam('subsections')) {
						$this->_children->subfolders();
					}
					if ($this->getParam('filter')) {
						list($filter) = explode(';',$this->getParam('filter'));
						eval('$this->_children->'.$filter.';');
					}
				}
				catch (\Exception $e) {
					return [];
				}					
			}
			if ($this->getParam('limit')) $this->_children->setItemCountPerPage($this->getParam('limit')); 
			if ($this->getParam('where')) $this->_children->where($this->getParam('where')); 
			$this->_children->setCurrentPageNumber( $this->getPage() ); 			
		}
		return $this->_children;
    }
1214916
public function getAllCategoryTreesAsArray()
    {
        $rootIds = $this->getAllRootIds();

        $trees = array();
        foreach ($rootIds as $rootId) {
            $trees[$rootId] = $this->getCategoryTreeAsArray($rootId);
        }

        return $trees;
    }
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;
  }
640804
public function SubSections($allChildren=true) {
		$subs = null;

		$childHolders = NewsHolder::get()->filter('ParentID', $this->ID);
		if ($childHolders && $childHolders->count()) {
			$subs = new ArrayList();
			foreach ($childHolders as $holder) {
				$subs->push($holder);
				if ($allChildren === true) {
					// see if there's any children to include
					$subSub = $holder->SubSections();
					if ($subSub) {
						$subs->merge($subSub);
					}
				}
			}
		}

		return $subs;
	}
163625
public function getChildren()
    {
        return $this->owner
            ->hasMany($this->ownerClassName, [ $this->parentIdField => $this->primaryKey ])
            ->orderBy([
                "$this->tableName.$this->sortField" => SORT_ASC,
                "$this->tableName.$this->primaryKey" => SORT_ASC,
            ]);
    }
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;
    }
531062
public function getChildren()
    {
        $element = $this->current();
        $childContext = $this->elementProcessor->processElementChildren(
            $element,
            $this->contexts[$this->contextMap[$this->key()]]
        );
        return new static($element->childNodes, $childContext, $this->elementProcessor);
    }
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;
    }
288782
public function CMSTreeClasses()
    {
        $classes = parent::CMSTreeClasses();
        
        $classes = ClassTools::singleton()->getStyleClasses($classes, static::class);
        
        if (!$this->canEdit()) {
            $classes .= ' hidden';
        }
        
        $this->extend('updateCMSTreeClasses', $classes);
        
        return $classes;
    }