@param $value
@return $this

@throws \IndexEngine\Exception\InvalidArgumentException

This method returns the object itself.
760025
public function setValue($value)
    {
        $this->clear();

        if (!is_array($value)) {
            $value = [$value];
        }

        foreach ($value as $argument) {
            $this[] = $argument;
        }
    }
158671
public function setInstances(int $value) : SearchIndex
    {

        if ($this->data['instances'] !== $value) {
            $this->data['instances'] = $value;
            $this->setModified('instances');
        }

        return $this;
    }
783090
public function setInternalValue($value)
    {
        if ($value instanceof \ArrayObject) {
            $value = $value->getArrayCopy();
        }

        if ($value instanceof \Iterator) {
            $value = iterator_to_array($value);
        }

        // force null values conversion to empty arrays
        if (is_null($value)) {
            $value = [];
        }

        if (!is_array($value)) {
            $value = [$value];
        }

        $this->clear();

        foreach ($value as $k => $v) {
            $this->set($k, $v);
        }

        return $this;
    }
771937
public function setValue($value)
    {
        $this->value = $value;
        if ($value instanceof ValueAwareInterface) {
            $this->value = $value->getFormValue();
        }
        return $this;
    }
843195
public function setUnserializeUndeclaredPropertyMode($value)
    {
        $availableOptions = [
            static::UNDECLARED_PROPERTY_MODE_SET,
            static::UNDECLARED_PROPERTY_MODE_IGNORE,
            static::UNDECLARED_PROPERTY_MODE_EXCEPTION
        ];
        if (!in_array($value, $availableOptions)) {
            throw new InvalidArgumentException('Invalid value.');
        }
        $this->undefinedAttributeMode = $value;
        return $this;
    }
96554
function setHelpers(array $value): self {
    if ($this->engine) $this->engine->setHelpers($value);
    else $this->helpers = $value;
    return $this;
  }
289278
public function setValue($value) {
		Argument::i()->test(1, 'scalar', 'array', 'null');
		
		if(!is_array($value)) {
			$value = func_get_args();
		}
		
		$this->value = $value;
			
		return $this;
	}
1357984
public function setOp($value): self
    {
        if (!in_array($value, self::ops(), true)) {
            throw new DomainException(sprintf(self::UNEXPECTED_OP, implode(', ', self::ops())));
        }

        return $this->setAttribute('op', $value);
    }
423761
protected function setValue($value)
    {
        if (is_string($value)) {
            $this->value = $value;
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($value). "' for argument 'value' given."
            );
        }

        return $this;
    }
474721
public function setDefault($value)
    {
        if (($value instanceof DateTime) === false) {
            throw new InvalidArgumentException(
                "invalid value provided for 'value'; ".
                "expecting an instance of DateTime"
            );
        }
        $this->defaultValue = $value;
        return $this;
    }
1135345
public function setDefaultValue($value)
    {
        if (($value instanceof ValueGenerator) === false) {
            $value = new ValueGenerator($value);
        }

        if ($this->isValidParameterDefaultValue($value) !== true) {
            throw new InvalidArgumentException('Parameter default value is not valid.');
        }

        $this->defaultValue = $value;

        return $this;
    }
148868
public function setValue( $value ) {
		$this->value = $this->cleanUpValue( $value );
		$this->input->setValue( $this->value );
		return $this;
	}
610280
public function setCoreRequestMethodStrict($value)
    {
        $this->setFieldName('request_method_strict');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
839596
public function setExpression($value)
    {
        $this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
        if (count($this->cronParts) < 6) {
            throw new InvalidArgumentException(
                $value . ' is not a valid CRON expression'
            );
        }

        foreach ($this->cronParts as $position => $part) {
            $this->setPart($position, $part);
        }

        return $this;
    }
1170627
public function set($key, $value)
    {
        if (!is_scalar($value) && !is_array($value)) {
            $msg = 'Value has to be a scalar or an array, but is '.gettype($value).'.';
            throw new InvalidArgumentException($msg);
        }

        $this->values[$key] = $value;

        return $this;
    }
1191451
public function setValue($value)
    {
        if ($value == $this->getAttribute('value')) {
            $this->check();
        } else {
            $this->uncheck();
        }
        return $this;
    }
1338788
public function setValue($value) {
		if(!in_array($value, self::VALID_VALUES)) {
			throw new InvalidArgumentException('Value is not valid.');
		}

		$this->value = $value;

		return $this;
	}