public function getLast($strType = "")
    {
        $varReturn = null;

        if (count($this->collection) > 0) {
            if (! empty($strType)) {
                $arrTemp = array_reverse($this->collection);
                foreach ($arrTemp as $object) {
                    if (get_class($object) == $strType) {
                        $varReturn = $object;
                        break;
                    }
                }
            } else {
                $varReturn = $this->collection[$this->count() - 1];
            }
        }

        return $varReturn;
    }
public function getLast($strType = "")
    {
        $varReturn = null;

        if (count($this->collection) > 0) {
            if (! empty($strType)) {
                $arrTemp = array_reverse($this->collection);
                foreach ($arrTemp as $object) {
                    if (get_class($object) == $strType) {
                        $varReturn = $object;
                        break;
                    }
                }
            } else {
                $varReturn = $this->collection[$this->count() - 1];
            }
        }

        return $varReturn;
    }
public function getLast ( $ strType = "" ) { $ varReturn = null ; if ( count ( $ this -> collection ) > 0 ) { if ( ! empty ( $ strType ) ) { $ arrTemp = array_reverse ( $ this -> collection ) ; foreach ( $ arrTemp as $ object ) { if ( get_class ( $ object ) == $ strType ) { $ varReturn = $ object ; break ; } } } else { $ varReturn = $ this -> collection [ $ this -> count ( ) - 1 ] ; } } return $ varReturn ; }
Get last element in collection

@param string $strType Optional type to search for. For example, you can search the Collection for the
last Hidden element by doing: `$objCollection->getLast("\\ValidFormBuilder\\Hidden")`.
@return mixed Returns last element in collection, null if collection is empty
Get last element in collection