Set Value Method

Sets the value for the property.
@param mixed $mixValue The value to check.
@throws TypeException if valud is not valid.
@return bool
557103
public function setValue($mixValue){
		if($this->isValid($mixValue) || is_null($mixValue)){
			$this->mixValue = $mixValue;
			return true;
		}

		throw new TypeException($mixValue, get_class($this));
	}
1319486
public function setStringValue($stringValue)
    {
        if (\is_array($stringValue) || \is_object($stringValue)) {
            $m = "Invalid value type for attribute {$this->getFamilyCode()}.{$this->getAttributeCode()}, ";
            $m .= 'expecting string, got '.gettype($stringValue);
            throw new \UnexpectedValueException($m);
        }
        if (null !== $stringValue && 255 < \mb_strlen($stringValue)) {
            $stringValue = mb_substr($stringValue, 0, 255);
        }
        $this->stringValue = null === $stringValue ? null : (string) $stringValue;

        return $this;
    }
1328113
public function setValue($v)
    {
        if ($v !== null) {
            $v = (string) $v;
        }

        if ($this->value !== $v) {
            $this->value = $v;
            $this->modifiedColumns[] = SystemSettingsPeer::VALUE;
        }


        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);
        }
    }
777871
public function setValue($value)
    {
        $hasType = isset($this->_type) && is_string($this->_type);
        $isMultiple = $hasType && strpos($this->_type, '[]') !== false;

        if ($hasType) {
            $value = $this->_castToExpression($value, $this->_type);
        }

        if ($isMultiple) {
            list($value, $this->_valueExpressions) = $this->_collectExpressions($value);
        }

        $this->_isMultiple = $isMultiple;
        $this->_value = $value;
    }
993089
public function setSourceValue($sourceValue)
    {
        if (is_float($sourceValue)) {
            $this->sourceValue = $sourceValue;
        } else {
            $msg = "SourceValue must be a float value, '" . gettype($sourceValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
409551
public function setValue($mixValue){
		if(is_null($mixValue)){
			$this->mixValue = null;
			return true;
		}

		$strClass = $this->options()->class;
		$this->mixValue = new $strClass($mixValue);
	}
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;
	}
856146
public function setValue($value = null, $type = self::T_TEXT)
    {
        unset($this->rawValue);
        unset($this->value);
        $this->_initValue($value, $type);
    }
1106258
public function offsetSet($mixOffset, $mixValue){
		if(!$this->isValidItem($mixValue)){
			$mixValue = $this->_create($mixValue);
		}

		parent::offsetSet($mixOffset, $mixValue);
	}
403419
public function setDefaultValue($defaultValue)
    {
        if (is_numeric($defaultValue)) {
            $this->defaultValue = $defaultValue;
        } else {
            $msg = "The 'defaultValue' argument must be a numeric value, '" . gettype($defaultValue) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
814100
public function setOptions($strClassName, $strFieldName, $mixValue)
    {
        if (empty ($mixValue)) {
            unset($this->options[$strClassName][$strFieldName]);
        } else {
            $this->options[$strClassName][$strFieldName] = $mixValue;
        }
        $this->blnChanged = true;
    }
87540
public function offsetGet($mixOffset){
		return isset($this->mixValue[$mixOffset]) ? $this->mixValue[$mixOffset] : null;
	}
1293074
public function setValue($value)
    {
        switch ($this->type) {
            case Parameter::TYPE_INTEGER:
                $this->value = (int) $value;
                break;
            case Parameter::TYPE_STRING:
            case Parameter::TYPE_ANY:
            default:
                $this->value = (string) $value;
        }

        return $this;
    }
29100
protected function _setValue($property, $value, $validate = true)
    {
        if ($this->_propertyExists($property)) {
            if ($validate) {
                self::$_manager->validateAttribute($this, $property, ['maxLength','readOnly'], $value);
            }
            if ($this->_propertyTypeAllowed($property, $value)) {
                $this->{$property} = $value;
            } else {
                $this->{$property} = $this->tryFormat($value, $this->_getPropertyType($property), $property);
            }
        } else {
            if ($this->_getDynamicAttributeDenied()) {
                throw new \Exception('Dynamic attribute: ' . $property . ' not allowed for entity ' . get_class($this));
            }
            $this->{$property} = $value;
        }
    }
75019
public static function literal($mixColValue)
    {
        if (is_null($mixColValue)) {
            return 'null';
        } elseif (is_integer($mixColValue)) {
            return $mixColValue;
        } elseif (is_bool($mixColValue)) {
            return ($mixColValue ? 'true' : 'false');
        } elseif (is_float($mixColValue)) {
            return "(float)$mixColValue";
        } elseif (is_object($mixColValue)) {
            return "t('" . $mixColValue->_toString() . "')";
        }    // whatever is suitable for the constructor of the object
        else {
            return "t('" . str_replace("'", "\\'", $mixColValue) . "')";
        }
    }
202987
private void setValue(Object newValue) {
        try {
            if (this.type == null)
                value = newValue;
            else if (this.type.equals("java.lang.String"))
                value = newValue;
            else if (this.type.equals("java.lang.Boolean"))
                value = Boolean.valueOf((String) newValue);
            else if (this.type.equals("java.lang.Integer"))
                value = new Integer(((String) newValue));
            else if (this.type.equals("java.lang.Double"))
                value = new Double(((String) newValue));
            else if (this.type.equals("java.lang.Byte"))
                value = new Byte(((String) newValue));
            else if (this.type.equals("java.lang.Short"))
                value = new Short(((String) newValue));
            else if (this.type.equals("java.lang.Long"))
                value = new Long(((String) newValue));
            else if (this.type.equals("java.lang.Float"))
                value = new Float(((String) newValue));
            else if (this.type.equals("java.lang.Character")) 
                value = Character.valueOf(((String) newValue).charAt(0)); 
            else
                value = newValue;

        } catch (NumberFormatException nfe) {
            Tr.warning(tc, "INCOMPATIBLE_PROPERTY_TYPE_J2CA0207", new Object[] { name, type, newValue });
        }

    }