Устанавливает флаг автоматического принятия поступившей оплаты
@param bool $value Автоматически принять поступившую оплату

@throws InvalidPropertyValueTypeException Генерируется если переданный аргумент не кастится в bool
357909
public function setCapture($value)
    {
        if ($value === null || $value === '') {
            $this->_capture = null;
        } elseif (TypeCast::canCastToBoolean($value)) {
            $this->_capture = (bool)$value;
        } else {
            throw new InvalidPropertyValueTypeException(
                'Invalid capture value type in CreatePaymentRequest', 0, 'CreatePaymentRequest.capture', $value
            );
        }
    }
256368
public function setAuthCode($value)
    {
        if ($value === null || $value === '') {
            $this->_authCode = $value;
        } elseif (TypeCast::canCastToEnumString($value)) {
            $this->_authCode = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException('Invalid auth_code value type', 0,
                'authorization_details.auth_code', $value);
        }
    }
44697
protected function procPropValue($value, array &$validPropertyValues)
    {
        // If the value is not a nested item
        if (!($value instanceof ValueInterface)) {
            throw new InvalidArgumentException(
                sprintf(InvalidArgumentException::INVALID_PROPERTY_VALUE_STR, gettype($value)),
                InvalidArgumentException::INVALID_PROPERTY_VALUE
            );
        }

        // If the value isn't empty
        if (!$value->isEmpty()) {
            $validPropertyValues[] = $value;
        }
    }
479127
public function setReason($value)
    {
        if ($value === null || $value === '') {
            throw new EmptyPropertyValueException('Empty reason value', 0, 'cancellation_details.reason');
        }
        if (TypeCast::canCastToEnumString($value)) {
            $value = strtolower((string)$value);
            if (CancellationDetailsReasonCode::valueExists($value)) {
                $this->_reason = $value;
            } else {
                throw new InvalidPropertyValueException(
                    'Invalid reason value: "'.$value.'"', 0, 'cancellation_details.reason', $value
                );
            }
        } else {
            throw new InvalidPropertyValueTypeException('Invalid reason value type', 0, 'cancellation_details.reason',
                $value);
        }
    }
488720
static public function false($value, $message = null, $propertyPath = null)
        {
            if ($value !== false) {
                $message = $message ?: sprintf(
                    'Value "%s" is not FALSE.',
                    static::stringify($value)
                );

                throw static::createException($value, $message, static::INVALID_FALSE, $propertyPath);
            }
        }
681884
protected function checkValueStructure(BaseValue $value)
    {
        if (isset($value->inputUri) && !is_string($value->inputUri)) {
            throw new InvalidArgumentType('$value->inputUri', 'string', $value->inputUri);
        }

        if (isset($value->id) && !is_string($value->id)) {
            throw new InvalidArgumentType('$value->id', 'string', $value->id);
        }

        // Required parameter $fileName
        if (!isset($value->fileName) || !is_string($value->fileName)) {
            throw new InvalidArgumentType('$value->fileName', 'string', $value->fileName);
        }

        // Optional parameter $alternativeText
        if (isset($value->alternativeText) && !is_string($value->alternativeText)) {
            throw new InvalidArgumentType(
                '$value->alternativeText',
                'string',
                $value->alternativeText
            );
        }

        if (isset($value->fileSize) && (!is_int($value->fileSize) || $value->fileSize < 0)) {
            throw new InvalidArgumentType(
                '$value->fileSize',
                'int',
                $value->alternativeText
            );
        }
    }
139565
public function setValue($value)
    {
        if (null !== $value) {
            if (!$this->validateValue($value)) {
                throw new \InvalidArgumentException(\sprintf(
                    'Binding invalid value (type "%s") into filter "%s" (%s)',
                    \is_object($value) ? \get_class($value) : \gettype($value),
                    $this->name,
                    \get_class($this)
                ));
            }

            $this->value = $value;
            $this->updateBound();
        }

        return $this;
    }
1312176
public function setAccountId($value)
    {
        if ($value === null || $value === '') {
            $this->_accountId = null;
        } elseif (TypeCast::canCastToString($value)) {
            $this->_accountId = (string)$value;
        } else {
            throw new InvalidPropertyValueTypeException(
                'Invalid accountId value type in RefundsRequest', 0, 'RefundsRequest.accountId', $value
            );
        }
    }
718219
public function setReceipt($value)
    {
        if (is_array($value)) {
            $this->receipt->fromArray($value);
        } elseif ($value instanceof ReceiptInterface) {
            $this->receipt = clone $value;
        } else {
            throw new InvalidPropertyValueTypeException('Invalid receipt value type', 0, 'receipt', $value);
        }

        return $this;
    }
871467
public function setValue($value)
	{
		$failure = true;
		switch($this->opration)
		{
			case '==':
				if($value==$this->condition)
					$failure = false;
				break;
			case '>':
				if($value>$this->condition)
					$failure = false;
				break;
			case '>=':
				if($value>=$this->condition)
					$faulure = false;
				break;
			case '<':
				if($value<$this->condition)
					$failure = false;
				break;
			case '<=':
				if($value<=$this->condition)
					$failure = false;
				break;
			case '*':
				if(strpos($value, $this->condition)!==false)
					$failure = false;
				break;
			case '^':
				if(strpos($value, $this->condition)===0)
					$failure = false;
				break;
			case '$':
				if(strrpos($value, $this->condition)==strlen($value)-strlen($this->condition))
					$failure = false;
				break;
			default:
				break;
		}
		if($failure)
			throw $this->getContext()->getModel('ValidationException', 'Form', array(
				array(
					'' => 'condition failed'
				)
			));
		return $value;
	}
772197
public function setValue($value) {
        switch ($this->type) {
            case self::TYPE_BOOLEAN:
                $this->value = (bool) $value;
                break;
            case self::TYPE_STRING:
                $this->value = (string) $value;
                break;
        }
        return $this;
    }
1261619
public function setBoolean($key, $value)
    {
        if (!settype($value, 'boolean')) {
            $errMsg = 'Ошибка при конвертации к типу bool';
            throw new Exception\PropertyException($errMsg);
        }
        $this->set(self::BOOLEAN, $key, $value);

        return $this;
    }
65802
public function validate($value): void
    {
        if (in_array($value, $this->values)) {
            return;
        }

        throw new Exception\Invalid(
            $value,
            "Invalid value, expected one of " . implode(",", $this->valuesString())
        );
    }
1116306
public function setReceiptItems($value)
    {
        $this->receipt->setItems(array());
        $index = 0;
        foreach ($value as $item) {
            if ($item instanceof ReceiptItemInterface) {
                $this->receipt->addItem($item);
            } else {
                if (empty($item['title']) && empty($item['description'])) {
                    throw new InvalidPropertyValueException(
                        'Item#'.$index.' title or description not specified',
                        0,
                        'AbstractPaymentRequestBuilder.items['.$index.'].title',
                        json_encode($item)
                    );
                }
                foreach (array('price', 'quantity', 'vatCode') as $property) {
                    if (empty($item[$property])) {
                        throw new InvalidPropertyValueException(
                            'Item#'.$index.' '.$property.' not specified',
                            0,
                            'AbstractPaymentRequestBuilder.items['.$index.'].'.$property,
                            json_encode($item)
                        );
                    }
                }
                $this->addReceiptItem(
                    empty($item['title']) ? $item['description'] : $item['title'],
                    $item['price'],
                    $item['quantity'],
                    $item['vatCode']
                );
            }
            $index++;
        }

        return $this;
    }
1203661
public function setValue($value)
	{
		// set default
		if( $value === "" )
		{
			$value = $this->value;
		}

		if( $this->type === "boolean" )
		{
			$value = is_bool($value) ? $value : in_array($value, ['y', 'yes', 'on', '1']);
		}
		else if( $this->type === "number" )
		{
			if( ! is_numeric($value) )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " must be a number");
			}
			$value = (float) $value;
			if( $this->required && $value === 0 )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " is required");
			}
		}
		else if( $this->type === "enum" )
		{
			if( ! in_array($value, $this->enum, true) )
			{
				$variant = "'" . implode("' or '", $this->enum) . "'";
				throw new \InvalidArgumentException($this->getTheTitle() . " must be equal " . $variant);
			}
		}
		else
		{
			$value = trim($value);
			if( $this->required && ! strlen($value) )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " is required");
			}
		}

		if( $this->type_of )
		{
			$value = call_user_func($this->type_of, $value);
			if( $value === false && $this->type !== "boolean" )
			{
				throw new \InvalidArgumentException($this->getTheTitle() . " value is invalid");
			}
		}

		$this->value = $value;
		return $this;
	}
465368
public function isValueValid($value) {
		return $value instanceof Type\EnumerationType || $value instanceof Type\PropertyValueType || $value instanceof Type\QualitativeValueType || $value instanceof Type\QuantitativeValueType || $value instanceof Type\StructuredValueType;
	}
248946
public function isValid($value)
    {
        if ( ! array_key_exists('fields', $this->getOptions())) {

            throw new \InvalidArgumentException(
                'Required option "property" not set for NoOtherObjectExists Validator.'
            );
        }

        if ( ! array_key_exists('class', $this->getOptions())) {

            throw new \InvalidArgumentException(
                'Required option "class" not set for NoOtherObjectExists Validator.'
            );
        }

        if ( ! array_key_exists('comparison_object', $this->getOptions())) {

            throw new \InvalidArgumentException(
                'Required option "comparison_object" not set for NoOtherObjectExists Validator.'
            );
        }

        if ( ! array_key_exists('identifier', $this->getOption('comparison_object'))) {

            throw new \InvalidArgumentException(
                'Required option "identifier" not set for NoOtherObjectExists Validator "comparison_object".'
            );
        }

        if ( ! array_key_exists('id', $this->getOption('comparison_object'))) {

            throw new \InvalidArgumentException(
                'Required option "id" not set for NoOtherObjectExists Validator "comparison_object".'
            );
        }

        $propertyName = $this->getOption('fields');
        $propertyClass = $this->getOption('class');

        $getterMethod = 'get' . ucfirst($propertyName);
        $cleanedValue = $this->cleanSearchValue($value);

        $comparisonObjectProperties = $this->getOption('comparison_object');
        $getIdentifier = 'get' . ucfirst($comparisonObjectProperties['identifier']);

        /** @var \object $comparisonObject */
        $comparisonObject = $this->objectRepository->findOneBy(
            [
                $comparisonObjectProperties['identifier'] => $comparisonObjectProperties['id'],
            ]
        );

        if ( ! method_exists($comparisonObject, $getterMethod)) {

            throw new \Exception(sprintf('Method %s() doesn\'t exist in class %s!', $getterMethod, $propertyClass));
        }

        $matches = $this->objectRepository->findBy($cleanedValue);
        if ($matches) {
            foreach ($matches as $index => $match) {
                // Check if the match has the same identifier as the object being edited. If it does continue, this is allowed.
                if (is_object($match)
                    && $match instanceof $propertyClass
                    && $match->$getIdentifier() === $comparisonObject->$getIdentifier()
                ) {

                    continue;
                }

                $this->error(self::ERROR_OBJECT_FOUND, $value);

                return false;
            }
        }

        return true;
    }