public function getElements($className = ''){

        $returnValue = array();

        if($className){
            foreach($this->elements as $serial => $element){
                if($element instanceof $className){
                    $returnValue[$serial] = $element;
                }
            }
        }else{
            $returnValue = $this->elements;
        }


        return $returnValue;
    }
public function getElements($className = ''){

        $returnValue = array();

        if($className){
            foreach($this->elements as $serial => $element){
                if($element instanceof $className){
                    $returnValue[$serial] = $element;
                }
            }
        }else{
            $returnValue = $this->elements;
        }


        return $returnValue;
    }
public function getElements ( $ className = '' ) { $ returnValue = array ( ) ; if ( $ className ) { foreach ( $ this -> elements as $ serial => $ element ) { if ( $ element instanceof $ className ) { $ returnValue [ $ serial ] = $ element ; } } } else { $ returnValue = $ this -> elements ; } return $ returnValue ; }
Get all elements of the given type
Returns all elements if class name is not specified

@param string $className
@return array
Get all elements of the given type Returns all elements if class name is not specified