Eccube\Entity\Category::getDescendants PHP 메소드

getDescendants() 공개 메소드

public getDescendants ( )
    public function getDescendants()
    {
        $DescendantCategories = array();
        $max = 10;
        $ChildCategories = $this->getChildren();
        foreach ($ChildCategories as $ChildCategory) {
            $DescendantCategories[$ChildCategory->getId()] = $ChildCategory;
            $DescendantCategories2 = $ChildCategory->getDescendants();
            foreach ($DescendantCategories2 as $DescendantCategory) {
                $DescendantCategories[$DescendantCategory->getId()] = $DescendantCategory;
            }
        }
        return $DescendantCategories;
    }