Returns all parents of a class.

@return array
437912
static public function getParents($className)
    {
        $parents = [];
        $parent = new \ReflectionClass($className);
        while (true) {
            $parent = $parent->getParentClass();
            if (!$parent) {
                break;
            } else {
                $parents[] = $parent->getName();
            }
        }
        return $parents;
    }
1038626
public static function getParentClasses($className) {
        $result = array();
        $class = new \ReflectionClass($className);
        if( false === $class ) {
            return $result;
        }
        do {
            $name = $class->getName();
            $result[] = $name;
            $class = $class->getParentClass();
        } while( false !== $class );
        return $result;
    }
353100
public function getElementalRelations()
    {
        $hasOnes = $this->owner->hasOne();

        if (!$hasOnes) {
            return false;
        }

        $elementalAreaRelations = [];

        foreach ($hasOnes as $hasOneName => $hasOneClass) {
            if ($hasOneName === 'Parent' || $hasOneName === 'ParentID') {
                continue;
            }

            if ($hasOneClass == ElementalArea::class || is_subclass_of($hasOneClass, ElementalArea::class)) {
                $elementalAreaRelations[] = $hasOneName;
            }
        }

        return $elementalAreaRelations;
    }
264777
public function getLists()
    {
        $returnValue = array();

        
        
        $returnValue[] = new core_kernel_classes_Class(GenerisRdf::GENERIS_BOOLEAN);
        
        foreach($this->parentListClass->getSubClasses(false) as $list){
        	$returnValue[] = $list;
        }
        
        
        
        

        return (array) $returnValue;
    }
738599
public static function getLeaves()
    {
        $parents  = static::select('parent_id')->whereNotNull('parent_id')->distinct()->get()->pluck('parent_id')->all();
        return static::wherenotin('id',$parents);
    }
57015
protected function getParentClasses(string $name) : array
    {
        // Collect parent classes, ignoring transient (not-mapped) classes.
        $parentClasses = [];

        $parentClasses = $this->getReflectionService()
            ->getParentClasses($name);

        foreach (array_reverse($parentClasses) as $parentClass) {
            if ($this->getDriver()->isTransient($parentClass)) {
                continue;
            }

            $parentClasses[] = $parentClass;
        }

        return $parentClasses;
    }
528429
public function getAncestors()
    {
        if($this->isRoot())
        {
            return array();
        }

        if($this->ancestors === 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());
            }

			$q = $qb->getQuery();
			if ($this->getManager()->getConfiguration()->isQueryHintSet()){
				$q = $this->getManager()->addHintToQuery($q);
			}
			$results = $q->getResult();

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

        return $this->ancestors;
    }
378675
protected function findParent(\ReflectionClass $class, $parents)
    {
        $parents = array_reverse($parents);

        foreach (array_reverse($parents) as $parent) {
            if ($class->getName() === get_class($parent)) {
                return $parent;
            }
        }

        foreach (array_reverse($parents) as $parent) {
            if ($class->isInstance($parent)) {
                return $parent;
            }
        }

        return null;
    }
392112
protected static function getAttrs()
    {
        $class = get_called_class();
        $parent = get_parent_class($class);
        if ($parent) {
            $attrs_parent = $parent::getAttrs();
            $attrs = array_merge($attrs_parent, $class::$attrs);
        } else {
            $attrs = $class::$attrs;
        }
        if(empty($attrs)) $attrs = array();

        return array_diff_key($attrs, array('__private__'));

    }
380561
public function getTeardown()
    {
        $parent = $this->with($this->_with)->getParent();
        $current = $this;
        $data[$current->id] = $current;
        while ($parent) {
            $data[$parent->id] = $parent;
            $parent = $parent->with($this->_with)->getParent();
        }

        return array_reverse($data, true);
    }
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, []);
    }
1259239
public function getParent()
    {
        if (\is_string($this->parent)) {
            $parent = TypeCollection::getInstance()->getTypeByName($this->parent);
            \assert($parent instanceof ObjectType);

            return $parent;
        }

        return $this->parent;
    }
441613
public function query() : array
    {
        $categories = Category::where('parent_id', null)->with('allChildrenTerm')->get();
        $allCategories = collect();

        foreach ($categories as $category) {
            $allCategories = $allCategories->merge($this->getCategory($category));
        }

        return [
            'category' => $allCategories,
        ];
    }
1297684
function getParentClass() {
    return FALSE !== $this->parentClass
      ? $this->parentClass
      : $this->parentClass = $this->buildParentClass();
  }
816296
public function getAncestorsNames()
    {
        $names = [];
        if ($this->hasParent()) {
            $names = $this->getParent()->getAncestorsNames();
        }
        $names[] = $this->getName();
        return $names;
    }
46878
public function doSort()
    {
        $this->sorted = array();

        foreach ($this->elements as $element) {
            $parents = array();
            $this->visit($element, $parents);
        }

        return $this->sorted;
    }
1296793
private function getParents($name) {
        if (!isset($this->_parents[$name])) {
            $class = new \ReflectionClass($name);
            $parents = array($name);
            $interfaces = $class->getInterfaceNames();
            while ($class = $class->getParentClass())
                $parents[] = $class->getName();
            $this->_parents[$name] = array_reverse($parents);
            foreach ($interfaces as $int) {
                $this->_parents[$name][] = $int;
            }
        }
        return $this->_parents[$name];
    }