public function getFieldNum($fieldName)
    {
        foreach( $this->_fields as $field ) {
            if( $field->name == $fieldName ) {
                return $field->number;
            }
        }

        return -1;
    }
public function getFieldNum($fieldName)
    {
        foreach( $this->_fields as $field ) {
            if( $field->name == $fieldName ) {
                return $field->number;
            }
        }

        return -1;
    }
public function getFieldNum ( $ fieldName ) { foreach ( $ this -> _fields as $ field ) { if ( $ field -> name == $ fieldName ) { return $ field -> number ; } } return - 1 ; }
Returns field index or -1 if field is not found

@param string $fieldName
@return integer
Returns field index or - 1 if field is not found