set Attribute

@param string            $key   The attribute name
@param \SimpleXMLElement $value The attribute value

@return object
544855
public function setAttribute($key, $value)
    {
        if (array_key_exists($key, static::$attributeTypeMapping)) {
            $type = strtolower(static::$attributeTypeMapping[$key]);
            switch ($type) {
                case 'boolean':
                case 'bool':
                    $value = (bool) filter_var($value, FILTER_VALIDATE_BOOLEAN);
                    break;
                case 'integer':
                case 'int':
                    $value = (int) $value;
                    break;
                case 'float':
                    $value = (float) $value;
                    break;
                case 'string':
                default:
                    $value = (string) $value;
                    break;
            }

            $this->attributes[$key] = $value;
        } else {
            throw new \InvalidArgumentException("Unexpected attribute '$key'.");
        }

        return $this;
    }
920671
public function set($name, $value)
    {
        if ( !$value ) {
            $this->attributes->remove($name);

            return $this;
        }
        $this->attributes->set($name, $value);

        return $this;
    }
944178
protected function setMappedAttribute($key, $value)
    {
        $segments = explode('.', $this->getMappingForAttribute($key));

        $attribute = array_pop($segments);

        if ($target = $this->getTarget($this, $segments)) {
            $this->addTargetToSave($target);

            $target->{$attribute} = $value;
        }
    }
929146
public function setAttribute($key, $value)
	{
		// Hash required fields when necessary
		if (in_array($key, $this->hashableAttributes) and ! empty($value))
		{
			$value = $this->hash($value);
		}

		return parent::setAttribute($key, $value);
	}
1254810
public function setAttribute($key, $value)
    {
        parent::setAttribute($key, $value); // TODO: Change the autogenerated stub

        if (isset($this->attributes[$key]) && is_string($this->attributes[$key]) && strlen($this->attributes[$key]) === 0) {
            $this->attributes[$key] = null;
        }

        return $this;
    }
922350
public function setAttribute($key, $value)
    {
        if (array_key_exists($key, $this->getMediaFiles())) {
            if ($value) {
                $this->media_files[$key]
                    ->setUploadedFile($value, $key);
            }

            return $this;
        }

        return parent::setAttribute($key, $value);
    }
825065
public function setAttribute($key, $value)
    {
        // First we will check for the presence of a mutator for the set operation
        // which simply lets the developers tweak the attribute as it is set on
        // the model, such as "json_encoding" an listing of data for storage.
        if ($this->hasSetMutator($key)) {
            $method = 'set' . Helper::studly($key) . 'Attribute';

            $this->{$method}($value);

            return;
        }
        if ($this->isJsonCastable($key)) {
            $value = json_encode($value);
        }
        $this->attributes[$key] = $value;
    }
974514
public function setAttribute($key, $value)
    {
        // First we will check for the presence of a mutator for the set operation
        // which simply lets the developers tweak the attribute as it is set on
        // the model, such as "json_encoding" an listing of data for storage.
        if ($this->hasSetMutator($key)) {
            $method = 'set'.Str::studly($key).'Attribute';

            return $this->{$method}($value);
        }

        // Get the method that modifies this value before storing.
        $method = $this->getCastToMethod($key);

        // Casting method is local.
        if (is_string($method) && method_exists($this, $method)) {
            $value = $this->$method($key, $value);
        }

        // If this attribute contains a JSON ->, we'll set the proper value in the
        // attribute's underlying array. This takes care of properly nesting an
        // attribute in the array's value in the case of deeply nested items.
        if (Str::contains($key, '->')) {
            return $this->fillJsonAttribute($key, $value);
        }

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

        return $this;
    }
1171607
public function setAttribute($key, $value)
    {
        return ( ! $this->isTranslatableAttribute($key) || is_array($value))
            ? parent::setAttribute($key, $value)
            : $this->setTranslation($key, $this->getLocale(), $value);
    }
531164
public function setAttribute($key, $value)
    {
        $key = strtolower($key);
        if ( ! is_array($value)) {
            $value = [
                'value'       => $value,
                'doubleQuote' => true,
            ];
        }
        $this->attr[$key] = $value;

        return $this;
    }
1182349
public function setAttribute($key, $value)
    {

        // if the value is already set, throw an exception
        if (isset($this[$uid = $this->maskKey($key)])) {
            throw new \Exception(
                sprintf('A value with key %s has already been set in application %s', $key, $this->getName())
            );
        }

        // append the value to the application
        $this[$uid] = $value;
    }
270561
public function set($key, $value)
    {
        if (method_exists($this, 'validate' . ucfirst($key))) {
            $value = call_user_func([$this, 'validate' . ucfirst($key)], $value);
        }

        $this->checkKeyExistInDefault($key);

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

        return $this;
    }
1151069
public function setAttribute($key, $value)
	{
		// First we will check for the presence of a mutator for the set operation
		// which simply lets the developers tweak the attribute as it is set on
		// the model, such as "json_encoding" an listing of data for storage.
		if ($this->hasSetMutator($key)) {
			$method = 'set' . Str::studly($key) . 'Attribute';

			return $this->{$method}($value);
		}

		// If an attribute is listed as a "date", we'll convert it from a DateTime
		// instance into a form proper for storage on the database tables using
		// the connection grammar's date format. We will auto set the values.
		elseif (in_array($key, $this->getDates()) && $value) {
			$value = $this->fromDateTime($value);
		}

		// Only set if the user can currently access
		if ($this->console_mode || $this->modify_authorizer->canAccess($key)) {
			if ($this->isJsonCastable($key) && ! is_null($value)) {
				$value = json_encode($value);
			}

			$this->attributes[$key] = $value;
		}
	}
637020
public function setAttr(string $name, string $value)
    {
        $this->attr[$name] = $value;

        return $this;
    }
1212629
public function set($key, $value)
    {
        if (!is_string($key)) {
            throw new ClientException('Invalid attribute key');
        }

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

        return $this;
    }
68377
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = 'set'.Str::studly($key).'Attribute';

            return $this->{$method}($value);
        }

        $this->model->attributes[$key] = $value;
    }
992812
function set($key, $value) {
        parent::set($key, $value);
        if($this !== $this->client->users) {
            $this->client->users->set($key, $value);
        }
        
        return $this;
    }