public function getComponentsBySameClass($lookingForChildClasses, $select = array())
    {
        $ret = array();
        if (!is_array($lookingForChildClasses)) {
            $lookingForChildClasses = array($lookingForChildClasses);
        }

        foreach ($lookingForChildClasses as $c) {
            if ($c == $this->componentClass) {
                $ret[] = $this;
                if (isset($limitCount) && $limitCount == 1) {
                    return $ret;
                }
            }
        }

        if (is_array($select)) {
            $select = new Kwf_Component_Select($select);
        } else {
            $select = clone $select;
        }
        $select->whereComponentClasses($lookingForChildClasses);

        if ($select->hasPart(Kwf_Component_Select::LIMIT_COUNT)) {
            $limitCount = $select->getPart(Kwf_Component_Select::LIMIT_COUNT);
        }

        foreach ($this->_getGeneratorsForClasses($lookingForChildClasses) as $generator) {
            foreach ($generator->getChildData(null, $select) as $data) {
                $ret[] = $data;
                if (isset($limitCount) && $limitCount - count($ret) <= 0) {
                    return $ret;
                }
            }
        }
        return $ret;
    }
public function getComponentsBySameClass($lookingForChildClasses, $select = array())
    {
        $ret = array();
        if (!is_array($lookingForChildClasses)) {
            $lookingForChildClasses = array($lookingForChildClasses);
        }

        foreach ($lookingForChildClasses as $c) {
            if ($c == $this->componentClass) {
                $ret[] = $this;
                if (isset($limitCount) && $limitCount == 1) {
                    return $ret;
                }
            }
        }

        if (is_array($select)) {
            $select = new Kwf_Component_Select($select);
        } else {
            $select = clone $select;
        }
        $select->whereComponentClasses($lookingForChildClasses);

        if ($select->hasPart(Kwf_Component_Select::LIMIT_COUNT)) {
            $limitCount = $select->getPart(Kwf_Component_Select::LIMIT_COUNT);
        }

        foreach ($this->_getGeneratorsForClasses($lookingForChildClasses) as $generator) {
            foreach ($generator->getChildData(null, $select) as $data) {
                $ret[] = $data;
                if (isset($limitCount) && $limitCount - count($ret) <= 0) {
                    return $ret;
                }
            }
        }
        return $ret;
    }
public function getComponentsBySameClass ( $ lookingForChildClasses , $ select = array ( ) ) { $ ret = array ( ) ; if ( ! is_array ( $ lookingForChildClasses ) ) { $ lookingForChildClasses = array ( $ lookingForChildClasses ) ; } foreach ( $ lookingForChildClasses as $ c ) { if ( $ c == $ this -> componentClass ) { $ ret [ ] = $ this ; if ( isset ( $ limitCount ) && $ limitCount == 1 ) { return $ ret ; } } } if ( is_array ( $ select ) ) { $ select = new Kwf_Component_Select ( $ select ) ; } else { $ select = clone $ select ; } $ select -> whereComponentClasses ( $ lookingForChildClasses ) ; if ( $ select -> hasPart ( Kwf_Component_Select :: LIMIT_COUNT ) ) { $ limitCount = $ select -> getPart ( Kwf_Component_Select :: LIMIT_COUNT ) ; } foreach ( $ this -> _getGeneratorsForClasses ( $ lookingForChildClasses ) as $ generator ) { foreach ( $ generator -> getChildData ( null , $ select ) as $ data ) { $ ret [ ] = $ data ; if ( isset ( $ limitCount ) && $ limitCount - count ( $ ret ) <= 0 ) { return $ ret ; } } } return $ ret ; }
Returns all components exactly matching a component class

Use with care, this is only efficient if a few components exist.

@see getComponentsByClass
@param string|array component class
@param array|Kwf_Component_Select
@return Kwf_Component_Data[]
Returns all components exactly matching a component class