Swat/SwatUIObject.php
public function getFirstAncestor($class_name)
    {
        if (!class_exists($class_name)) {
            return null;
        }

        if ($this->parent === null) {
            $out = null;
        } elseif ($this->parent instanceof $class_name) {
            $out = $this->parent;
        } else {
            $out = $this->parent->getFirstAncestor($class_name);
        }

        return $out;
    }
public function getFirstAncestor($class_name)
    {
        if (!class_exists($class_name)) {
            return null;
        }

        if ($this->parent === null) {
            $out = null;
        } elseif ($this->parent instanceof $class_name) {
            $out = $this->parent;
        } else {
            $out = $this->parent->getFirstAncestor($class_name);
        }

        return $out;
    }
public function getFirstAncestor ( $ class_name ) { if ( ! class_exists ( $ class_name ) ) { return null ; } if ( $ this -> parent === null ) { $ out = null ; } elseif ( $ this -> parent instanceof $ class_name ) { $ out = $ this -> parent ; } else { $ out = $ this -> parent -> getFirstAncestor ( $ class_name ) ; } return $ out ; }
Gets the first ancestor object of a specific class

Retrieves the first ancestor object in the parent path that is a
descendant of the specified class name.

@param string $class_name class name to look for.

@return mixed the first ancestor object or null if no matching ancestor
is found.

@see SwatUIParent::getFirstDescendant()
Gets the first ancestor object of a specific class