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
778071
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;
    }
590227
public function setOptions(array $options)
    {
        foreach ($options as $name => $value) {
            $method = 'set' . $name;
            if (! method_exists($this, $method)) {
                // next major: throw an exception
                @trigger_error(sprintf(
                    'The "%s" column option is not supported,' .
                    ' setting it is deprecated and will cause an error in Doctrine 3.0',
                    $name
                ), E_USER_DEPRECATED);

                continue;
            }
            $this->$method($value);
        }

        return $this;
    }
1272102
public function checkbox(string $name, array $options = []): FieldTypeInterface
    {
        return (new CheckboxType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
123872
protected function need_update($name, $version){
        return !isset($this->option[$name]) || !$this->option[$name] || version_compare($this->option[$name], $version, '<');
    }
1118288
public function createVersion($project_key, $version, array $options = array())
	{
		$options = array_merge(
			array(
				'name' => $version,
				'description' => '',
				'project' => $project_key,
				// 'userReleaseDate' => '',
				// 'releaseDate' => '',
				'released' => false,
				'archived' => false,
			),
			$options
		);

		return $this->api(self::REQUEST_POST, '/rest/api/2/version', $options);
	}
640290
public function setVersion($version)
    {
        if (Version::isKnown($version) === true) {
            $this->version = Version::appendPatchVersion($version);
        } else {
            $msg = "Version '{$version}' is not a known QTI version. Known versions are '" . implode(', ', Version::knownVersions()) . "'";
            throw new InvalidArgumentException($msg);
        }
    }
759357
public function submit(string $name, array $options = []): FieldTypeInterface
    {
        return (new SubmitType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
859485
public function setApplication(string $name, string $version = '')
    {
        $this->application = $name.($version ? '/'.$version : '');

        // Reset the cached value
        $this->cachedUserAgent = null;

        return $this;
    }
1293964
public function password(string $name, array $options = []): FieldTypeInterface
    {
        return (new PasswordType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
1152638
public function setName($contentId, $version, $name, $language)
    {
        try {
            return $this->innerGateway->setName($contentId, $version, $name, $language);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
551048
public function setVersion(string $version)
    {
        if (!preg_match('/^\d+\.\d+\.\d+$/', $version)) {
            throw new \InvalidArgumentException(
                'Version number is invalid; ' . $version . ' does not match '
                . 'x.x.x (where x is a number)'
            );
        }

        $this->version = $version;
    }
929188
public function setKeyName($name = "")
    {
        if (empty($name)) {
            throw new GdgCommonsInvalidArgumentException("Key name must not be null or empty");
        }
        
        if (!is_string($name)) {
            throw new GdgCommonsInvalidArgumentException("Key name must be string");
        }
        
        $this->_keyName = $name;
    }
728885
public function setLngProperty($key)
    {
        if ($key === null) {
            $this->lngProperty = $key;
            return $this;
        }

        if (!is_string($key)) {
            throw new InvalidArgumentException(
                'The "lng_property" must be a string'
            );
        }

        $this->lngProperty = $key;
        return $this;
    }
1130783
public function setVersion($version)
    {
        if (!in_array($version, $this->supportedVersions)) {
            $this->throwError('The version ' . $version . ' is not supported by this library');
        }

        $this->version = $version;

        return $this;
    }
188886
public function set($name = null, $version = null)
    {
        if ($name !== null) {
            $this->name = trim($name);
        }

        if ($version !== null) {
            $this->version = trim($version);
        }

        return true;
    }
1031298
public function setProtocolVersion($version)
    {
        if (!preg_match('/^\d(\.\d+)+$/', $version))
        {
            throw new InvalidArgumentException('Invalid protocol version: ' . $version);
        }
        $this->protocolVersion = $version;
        return $this;
    }
293044
public function setVersion($version)
    {
        if(!is_float($version)){
            $version = (float) 1.1;
        }

        $this->options['version']=$version;
        return $this;
    }