EAV attribute setter

@param   string $attribute
@param   string $value

@throws \OutOfBoundsException

@return  mixed
540692
protected function _set_eav($attribute, $value)
	{
		// get the current class name
		$class = get_called_class();

		// don't do anything unless we actually have an EAV container
		if (property_exists($class, '_eav'))
		{
			// loop through the defined EAV containers
			foreach (static::$_eav as $rel => $settings)
			{
				// normalize the container definition, could be string or array
				if (is_string($settings))
				{
					$rel = $settings;
					$settings = array();
				}

				// fetch the relation object for this EAV container
				if ( ! $relation = static::relations($rel))
				{
					throw new \OutOfBoundsException('EAV container defines a relation that does not exist in '.get_class($this).'.');
				}

				// EAV containers must be of the "Many type"
				if ($relation instanceOf \Orm\HasOne or $relation instanceOf \Orm\BelongsTo)
				{
					throw new \OutOfBoundsException('EAV containers can only be defined on "HasMany" or "ManyMany" relations in '.get_class($this).'.');
				}

				// determine attribute and value column names
				$attr = isset($settings['attribute']) ? $settings['attribute'] : 'attribute';
				$val = isset($settings['value']) ? $settings['value'] : 'value';

				// loop over the resultset
				foreach ($this->{$relation->name} as $key => $record)
				{
					if ($record->{$attr} === $attribute)
					{
						$record->{$val} = $value;
						return true;
					}
				}

				// not found, we've got outselfs a new attribute, so add it
				if ($rel = static::related_class($rel))
				{
					$this->{$relation->name}[] = $rel::forge(array(
						$attr => $attribute,
						$val => $value,
					));
					return true;
				}
			}
		}

		return false;
	}
455443
function offsetSet($offset, $value)
    {
        if (!$value instanceof Attribute) {
            throw new InvalidArgumentException(
                "Value is not an instance of \\Sirel\\Attribute"
            );
        }
        $this->attributes[$offset] = $value;
    }
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;
    }
376335
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = 'set' .Str::studly($key) .'Attribute';

            return call_user_func(array($this, $method), $value);
        } else if (in_array($key, $this->getDates()) && $value) {
            $value = $this->fromDateTime($value);
        }

        $this->attributes[$key] = $value;
    }
414583
protected function modifyAttributeValue(string $attribute, $value)
    {
        $attributeModifiers = $this->getAttributeModifiers();

        if (!array_key_exists($attribute, $attributeModifiers)) {
            return $value;
        }

        $attributeModifier = $attributeModifiers[$attribute];

        if (is_subclass_of($attributeModifier, AttributeRedactor::class)) {
            return call_user_func([$attributeModifier, 'redact'], $value);
        }

        if (is_subclass_of($attributeModifier, AttributeEncoder::class)) {
            return call_user_func([$attributeModifier, 'encode'], $value);
        }

        throw new AuditingException(sprintf('Invalid AttributeModifier implementation: %s', $attributeModifier));
    }
8792
public function setAttribute($attribute, $value){
        if($attribute === 'table'){
            $this->_table = $value;
        }
        elseif($attribute === 'pk'){
            $this->_pk = $value;
        }
        elseif($attribute === 'relations'){
            $this->_relations = $value;
        }
        
        return $this;
    }
144778
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 ( $value && ( in_array( $key, $this->getDates() ) || $this->isDateCastable( $key ) ) )
		{
			$value = $this->fromDateTime( $value );
		}

		if ( $this->isJsonCastable( $key ) && !is_null( $value ) )
		{
			$value = $this->asJson( $value );
		}

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

		return $this;
	}
657013
public function setAttribute($attribute, $value)
    {
        array_set($this->cart->attributes, $attribute, $value);

        $this->update();
    }
354671
public function addAttributeValue(string $attribute, string $value = ''): self
    {
        // Retrieve the current values of the attribute
        $values = $this->getAttribute($attribute);

        // Merge the values
        if (! in_array($value, $values)) {
            $values[] = $value;
        }

        // Store the new values
        $this->setAttribute($attribute, $values);

        return $this;
    }
816873
public function withAttribute($attribute, $value)
    {
        $new = $this->psrRequest->withAttribute($attribute, $value);
        return new self($new, $this->originalRequest);
    }
246210
public function remove($attribute)
    {
        if (!$this->has($attribute)) {
            throw new \OutOfBoundsException("Attribute '{$attribute}' does not exist");
        }

        unset($this->attributes[$attribute]);

        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;
		}
	}
1305874
protected function setAttributeFromLdap(array $entry, $attribute, $value)
    {
        if (isset($value['count']) && $value['count'] == 1) {
            $entry[$attribute] = $value[0];
        } elseif (isset($value['count']) && $value['count'] > 0) {
            $entry[$attribute] = [];
            for ($i = 0; $i < $value['count']; $i++) {
                $entry[$attribute][] = $value[$i];
            }
        } elseif ($attribute === 'dn') {
            $entry[$attribute] = $value;
        }

        return $entry;
    }
1286832
protected function attributeHasValue($attribute, $value)
    {
        $attribute = $this->resolveAttributeName($attribute);

        if (is_array($this->attributes[$attribute])) {
            return in_array($value, $this->attributes[$attribute]);
        } else {
            return ($this->attributes[$attribute] == $value);
        }
    }
612637
protected function setDynamicEncryptable($attribute, $value)
    {
        // Dynamically set the encryptable attribute
        if ($this->isEncryptable($attribute)) {
            // Encrypt only decrypted values
            if ($this->isDecrypted($attribute)) {
                $this->setEncryptingAttribute($attribute, $value);

                return true;
            }
        }

        return false;
    }
267596
public function changing($attribute, $value)
    {
        $this->setToken('Attribute', $attribute);
        $this->setToken('Value', $value);

        return $this;
    }
1112636
function set($attribute,$value = '')
	{
		if(!is_array($attribute))
		{
			$this->attributes[$attribute] = $value;
		}
		else
		{
			$this->attributes = array_merge($this->attributes,$attribute);
		}
	}