Sets "to" value property name, which contains the "to" value.

@param string $toValuePropertyName

@return static
@throws InvalidArgumentException On invalid argument
491945
public function setToValuePropertyName($toValuePropertyName)
    {
        if (!is_string($toValuePropertyName) || empty($toValuePropertyName)) {
            throw new InvalidArgumentException('"To value property name" argument must be string and must not be empty.');
        }

        if (!property_exists($this, $toValuePropertyName)) {
            throw new InvalidArgumentException(sprintf('Property "%s" does not exist.', $toValuePropertyName));
        }

        $this->toValuePropertyName = $toValuePropertyName;

        return $this;
    }
1011805
protected function validateValue($property, $value)
    {
        $this->isPropertyValid($property);

        $regEx = '/^' . self::CONFIRMATION_PROPERTIES[$property] . '$/';

        if (preg_match($regEx, $value) != 1) {
            throw new InvalidArgumentException("The value " . $value . " for the property " . $property . ", is invalid");
        }

        return $value;
    }
29946
protected function CleanAndBuildConstantKeyValue($rawValue, $valueToTrim) {
        $valueCleaned = $this->RemoveExtensionFileName($rawValue, $valueToTrim);
        return $this->BuildConstantKeyValue($valueCleaned);
    }
275258
public function registerNamedValue($valueName)
    {
        if (isset($this->namedValues[$valueName])) {
            throw new \InvalidArgumentException("`$valueName` is already registerd.");
        }

        $this->namedValues[$valueName] = true;

        return $this;
    }
263907
public function setManyToManyEntityName($manyToManyEntityName)
    {
        if (!is_string($manyToManyEntityName)) {
            throw new \InvalidArgumentException('The attribute manyToManyEntityName on the class Attribute has to be string (' . gettype($manyToManyEntityName) . ('object' === gettype($manyToManyEntityName) ? ' ' . get_class($manyToManyEntityName) : '') . ' given).');
        }

        $this->manyToManyEntityName = $manyToManyEntityName;

        return $this;
    }
788023
public static String setProperty(ArgumentUnit argumentUnit, String propertyName,
            String propertyValue)
    {
        Properties properties = ArgumentUnitUtils.getProperties(argumentUnit);
        String result = (String) properties.setProperty(propertyName, propertyValue);
        ArgumentUnitUtils.setProperties(argumentUnit, properties);

        return result;
    }
1164945
protected function setValue($value)
    {
        if (is_string($value)) {
            $value = trim($value);
            if ($value !== "") {
                $this->value = $value;
            } else {
                throw new \InvalidArgumentException("Invalid value for argument 'value' given.");
            }
        } else {
            throw new \InvalidArgumentException(
                "Invalid type '" . gettype($value) . "' for argument 'value' given. String expected."
            );
        }

        return $this;
    }
118608
public function setValueType($valueType)
    {
        if (in_array($valueType, ParamType::asArray(), true) === true) {
            $this->valueType = $valueType;
        } else {
            $msg = "The 'valueType' argument must be a value from the ParamType enumeration, '" . gettype($valueType) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
507433
protected function valPropName($property)
    {
        $propertyName = trim($property->name);

        // If the property name is empty
        if (!strlen($propertyName)) {
            throw new InvalidArgumentException(
                InvalidArgumentException::EMPTY_PROPERTY_NAME_STR,
                InvalidArgumentException::EMPTY_PROPERTY_NAME
            );
        }

        return $propertyName;
    }
1198504
public function setToType($to_type)
    {
        if ($to_type == $this->to_type) return $this;
        $to_type = strtoupper($to_type);
        if (!isset(self::getAddressTypes()[$to_type])) {
            throw new \InvalidArgumentException(sprintf('The "%s" to_type is not a valid address type.', $to_type));
        }
        $this->to_type = $to_type;
        return $this;
    }
913238
public function getSetter($apiPropertyName)
    {
        $property = $this->getProperty($apiPropertyName);

        return 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $property)));
    }
687130
public function setDocumentProperty($propertyName = '', $propertyValue = '')
    {

        if ($propertyName == '')
            throw new Exception('Property name not specified');

        //build URI to replace image
        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/documentProperties/' . $propertyName;

        $putArray['Value'] = $propertyValue;
        $json = json_encode($putArray);

        //sign URI
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'PUT', 'json', $json);

        $response_arr = json_decode($responseStream);

        return $response_arr->DocumentProperty;
    }
47973
public function setProperty(&$object, $propertyName, $propertyValue)
    {
        $property = $this->getPropertyInstance($object, $propertyName);
        $property->setAccessible(true);
        $property->setValue($object, $propertyValue);
    }
632260
public static function setFieldValue($instance, $fieldName, $value)
    {
        $setterMethodName = 'set'.ucfirst($fieldName);

        try {
            $ref = new \ReflectionClass($instance);
            $ref->getMethod($setterMethodName);
        } catch (\Exception $e) {
            throw new \InvalidArgumentException(sprintf('The setter method "%s" that should be used for property "%s" seems not to exist. Please check your spelling in the command option or in your implementation class.', $setterMethodName, $fieldName));
        }

        $instance->$setterMethodName($value);
    }
406655
public function setProperty($propertyName, $propertyValue)
    {
        Validate::isString($propertyName, 'propertyName');
        Validate::notNull($propertyValue, 'propertyValue');

        $this->_customProperties[strtolower($propertyName)] = $propertyValue;
    }
532989
protected function getValues($apiPropertyName)
    {
        $mapping = $this->getMapping();

        return array_key_exists($apiPropertyName, $mapping) ? $mapping[$apiPropertyName] : array();
    }
201950
public function removeProperty($nameOrProperty) {
		if ($nameOrProperty instanceof PhpProperty) {
			$nameOrProperty = $nameOrProperty->getName();
		}

		if (!$this->properties->has($nameOrProperty)) {
			throw new \InvalidArgumentException(sprintf('The property "%s" does not exist.', $nameOrProperty));
		}
		$p = $this->properties->get($nameOrProperty);
		$p->setParent(null);
		$this->properties->remove($nameOrProperty);

		return $this;
	}