public function findFieldInArray($fieldname) {
        foreach ($this->fields as $i => $field) {
            if ($fieldname == $field->getName()) {
                return $i;
            }
        }
        return null;
    }
public function findFieldInArray($fieldname) {
        foreach ($this->fields as $i => $field) {
            if ($fieldname == $field->getName()) {
                return $i;
            }
        }
        return null;
    }
public function findFieldInArray ( $ fieldname ) { foreach ( $ this -> fields as $ i => $ field ) { if ( $ fieldname == $ field -> getName ( ) ) { return $ i ; } } return null ; }
Returns the position of one field in the array.
@param string $fieldname
@return int|null index of the field, or null if not found.
Returns the position of one field in the array .