public function getFieldByName($name)
    {
        foreach ($this->fields as $field) {
            if ($field->getName() == $name) {
                return $field;
            }
        }

        return null;
    }
public function getFieldByName($name)
    {
        foreach ($this->fields as $field) {
            if ($field->getName() == $name) {
                return $field;
            }
        }

        return null;
    }
public function getFieldByName ( $ name ) { foreach ( $ this -> fields as $ field ) { if ( $ field -> getName ( ) == $ name ) { return $ field ; } } return null ; }
Return a field by it's name. We will return null if it's not found.

@param string $name
@return AbstractFormField
Return a field by it s name . We will return null if it s not found .