public function getFirstElementOfType($classnames)
    {
        if (!is_array($classnames)) {
            $classnames = array($classnames);
        }

        foreach (array_keys($this->_data) as $key) {
            $element = $this->getData($key);

            if (!is_object($element)) {
                continue;
            }

            foreach ($classnames as $classname) {
                if (is_a($element, $classname)) {
                    return $element;
                }
            }
        }
    }
public function getFirstElementOfType($classnames)
    {
        if (!is_array($classnames)) {
            $classnames = array($classnames);
        }

        foreach (array_keys($this->_data) as $key) {
            $element = $this->getData($key);

            if (!is_object($element)) {
                continue;
            }

            foreach ($classnames as $classname) {
                if (is_a($element, $classname)) {
                    return $element;
                }
            }
        }
    }
public function getFirstElementOfType ( $ classnames ) { if ( ! is_array ( $ classnames ) ) { $ classnames = array ( $ classnames ) ; } foreach ( array_keys ( $ this -> _data ) as $ key ) { $ element = $ this -> getData ( $ key ) ; if ( ! is_object ( $ element ) ) { continue ; } foreach ( $ classnames as $ classname ) { if ( is_a ( $ element , $ classname ) ) { return $ element ; } } } }
Returns the first element of one of the provided class is exists.

@param mixed $classnames

@return AbstractClassContent|NULL
Returns the first element of one of the provided class is exists .