public function setField($key, $name, $version = '', array $options = [])
    {
        $field = [
            'name' => $name
        ];

        if (!empty($version)) {
            $field['version'] = $version;
        }

        if (!empty($options)) {
            $field['options'] = $options;
        }

        $this->fields[$key] = $field;

        return $this;
    }
public function setField($key, $name, $version = '', array $options = [])
    {
        $field = [
            'name' => $name
        ];

        if (!empty($version)) {
            $field['version'] = $version;
        }

        if (!empty($options)) {
            $field['options'] = $options;
        }

        $this->fields[$key] = $field;

        return $this;
    }
public function setField ( $ key , $ name , $ version = '' , array $ options = [ ] ) { $ field = [ 'name' => $ name ] ; if ( ! empty ( $ version ) ) { $ field [ 'version' ] = $ version ; } if ( ! empty ( $ options ) ) { $ field [ 'options' ] = $ options ; } $ this -> fields [ $ key ] = $ field ; return $ this ; }
Sets the specified field.

@param string $key     Component key, e.g. 'Language'
@param string $name    Component name, e.g. 'PHP'
@param string $version Version identifier, e.g. '5.4.10'
@param array  $options Additional information

@return self
Sets the specified field .