___set

@param $name
@param $value

@throws TExceptionAbstract
182749
private function ___set($name, $value)
    {
        /**
         * @var PropertyContract $meta
         */
        $meta = self::$schema->getPropertyEntryByIdentifier($name);

        if (!$meta) {
            return;
        }

        $isRequired = $meta->getBehavior()->isRequired();

        if (is_null($value) && $isRequired) {
            throw new Exception("Propriedade obrigatória não pode ser nula [ " . $name . " ]", 400);
        }

        if ($value) {
            $value = Validator::make(self::$schema)->validate($name, $value);

            if ($meta->getAllowedValues()) {

                if (!in_array($value, $meta->getAllowedValues())) {

                    $msg = "Valor [ {$value} ] para [ {$name} ] esta fora do intervalo permitido ";
                    $msg .= '[ ' . implode(',', $meta->getAllowedValues()) . ' ]';

                    throw new Exception($msg, 400);
                }
            }
        }

        if (method_exists($this, 'set' . ucfirst($name))) {
            $this->{'set' . ucfirst($name)}($value);
        } else {
            $this->{$name} = $value;
        }
    }
1066419
public function set($name, $value)
    {
        $this->helper()->arr()->set($this->object, $name, $value);
    }
130292
public function set($name, $value)
    {
        $target = &$this->get($name);
        if ((!is_array($value) && $target instanceof Field\FormField) || $target instanceof Field\ChoiceFormField) {
            $target->setValue($value);
        } elseif (is_array($value)) {
            $fields = self::create($name, $value);
            foreach ($fields->all() as $k => $v) {
                $this->set($k, $v);
            }
        } else {
            throw new \InvalidArgumentException(sprintf('Cannot set value on a compound field "%s".', $name));
        }
    }
455087
protected function setFormParameter(string $name, string $value): void
    {
        $this->formParameters->set($name, $value);
    }
715672
public function setCustomItem(string $name, $value): void
    {
        $this->customItems->set($name, $value);
    }
589594
public function setValue($name, $value = '')
    {
        if (\is_array($name)) {
            foreach ($name as $key => $val) {
                if (isset($this->$key)) {
                    $this->$key = $val;
                }
            }
        } else {
            if (isset($this->$name)) {
                $this->$name = $value;
            }
        }
    }
560257
public function setParam($name, $value) {
        if (in_array($name, $this->_textParamNames)) {
            $this->_setTextParam($name, $value);
        } else if (in_array($name, $this->_rawParamNames)) {
            $this->_setRawParam($name, $value);
        } else {
            throw new CPS_Exception(array(array('long_message' => 'Invalid request parameter', 'code' => ERROR_CODE_INVALID_PARAMETER, 'level' => 'REJECTED', 'source' => 'CPS_API')));
        }
    }
1073
public function set($name, $value = null)
    {
        if (is_array($name)) {
            $this->parameters = array_replace($this->parameters, $name);
        } else {
            $this->parameters[trim(strtolower($name))] = is_string($value) ? trim($value) : $value;
        }
    }
1325558
public function _set($name, $value)
    {
        $object = $this->getObject();
		$callable = function() use ($name, $value, $object) {
			if (!property_exists($object, $name) && !method_exists($object, '__set'))
			{
				throw new \Exception('Property ' . $name . ' doesn\'t exist on object of class ' . get_class($object));
			}
			$object->$name = $value;
		};
		$this->breakScopeAndExecute($callable);
    }
619259
public function setValue($name, $value)
    {
        // handle field
        if (static::fieldExists($name)) {
            $this->_setFieldValue($name, $value);
        }
        // undefined
        else {
            return false;
        }
    }
961341
public function set(string $name, $value): void
    {
        $this->loader->setVariable($name, $value);
    }
693071
public function setAttribute( $name, $value ) {
        if( strtolower( $name ) == 'value' ) {
            $this->setSelectedOption( $value );
        } else {
            parent::setAttribute( $name, $value );
        }
    }
1043833
public function set($name, $value)
    {
        $name = strtolower($name);

        if (isset($this->obj_headers[$name])) {
            $this->{$this->obj_headers[$name]} = $value;
        }
        else {
            $this->others[$name] = $value;
        }
    }
760931
public function offsetSet($name, $value)
    {
        if ($name == '_id') {
            throw new \Exception('Property "_id" is read-only');
        } elseif ($name === null) {
            throw new \Exception('Property name cannot be null');
        } else {
            parent::offsetSet($name, $value);
        }
    }
1047118
public function setOption($name, $value = null)
    {
        if (is_array($name)) {
            $this->_option = $name;
        } elseif (is_null($value)) {
            unset($this->_option[$name]);
        } else {
            $this->_option[$name] = $value;
        }
    }
448445
public function setAttribute($name, $value = null)
    {
        if (is_array($name)) {
            foreach ($name as $k => $v) {
                $this->attributes[$k] = $v;
            }
        } else {
            $this->attributes[$name] = $value;
        }
    }
63172
public function setOption($name, $value=null)
    {
        if (is_array($name)) {
            $this->options = array_merge($this->options, $name);
        } else {
            $this->options[$name] = $value;
        }
    }