Set a statement attribute.

@param string $key Attribute name.
@param mixed  $val Attribute value.
@return bool
@throws Zend_Db_Statement_Exception
962892
public function setAttribute($key, $val)
    {
        try {
            return $this->_stmt->setAttribute($key, $val);
        } catch (PDOException $e) {
            // require_once 'Zend/Db/Statement/Exception.php';
            throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
        }
    }
437169
public function set($key, $val)
    {
        $this->_data = Hash::merge([$key => $val], $this->_data);
        return $this;
    }
558632
protected function input($key, $val)
    {
        $extra = [
            'type' => strtolower(__FUNCTION__),
        ];

        return $this->composeElement($key, $val, $extra, true);
    }
1144920
public function setDefaultData($key, $val = null)
    {
        if(is_array($key))
        {
            foreach($key as $k=>$v)
            {
                $this->setDefaultData($k, $v);
            }
        }
        else
        {
            $this->defaultData[$key] = $val;
        }

        return $this;
    }
545622
public static function set(array $root, string $key, $val){
        $origin = $root;
        $node   = &$root;

        foreach(explode(".", $key) as $key){
            if(!is_array($key) || !array_key_exists($key, $node)){
                return $origin;
            }

            $node   = &$node[$key];
        }

        $node   = $val;

        return $root;
    }
25207
public function set($key, $val, $expire = 0)
    {
        return $this->mem->set($key, $val, $expire);
    }
402428
public function set(string $key, $val)
    {
        // set the variable
        if (empty($key)) {
            return $this;
        }

        $node = $this->mainNode->getLastByKey($key);

        if (!$node || !$node->getParent()) {
            $newNode = new Node($this->mainNode, $key, $val);
            $this->mainNode->addChild($newNode);
        } else {
            $newNode = new Node($node->getParent(), $key, $val);
            $node->getParent()->addChild($newNode);
        }

        $this->lastNewNode = $newNode;

        return $this;

    }
1374091
public function write($key, $val)
    {
        $key = strval($key);

        if(strlen($key) == 0)
        {
            $msg = 'The key cannot be empty.';
            throw new InvalidArgumentException($msg);
        }

        $this->openSession();
        $_SESSION[$key] = $val;
        $this->closeSession();
    }
799833
public static function setContextDataByKey(string $key, $val)
    {
        $coroutineId = self::getCoroutineId();
        self::$context[$coroutineId][self::DATA_KEY][$key] = $val;
    }
227411
public function assignByRef($key, &$val = null)
    {
        if (is_array($key)) {
            foreach ($key as $k => &$v) {
                $this->args[$k] = $v;
            }
        } else {
            $this->args[$key] = $val;
        }
        return $this;
    }
839071
function update( $key, $val = false ) {
			if ( ! is_array( $key ) ) {
				$key = array( $key => $val );
			}

			$is_updated = false;

			foreach ( $key as $k => $v ) {
				if ( $this->{$k} === $v ) {
					continue;
				}

				if ( ( is_string( $this->{$k} ) && is_numeric( $v ) ||
				       ( is_numeric( $this->{$k} ) && is_string( $v ) ) ) &&
				     $this->{$k} == $v
				) {
					continue;
				}

				// Update value.
				$this->{$k} = $v;

				$is_updated = true;
			}

			$this->_is_updated = $is_updated;

			return $is_updated;
		}
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;
    }
1140728
public function set($key, $val = null)
    {
        if (is_array($key)) {
            $_SESSION = array_merge($_SESSION, $key);
        } else {
            $this->offsetSet($key, $val);
        }
        return $this;
    }
223521
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)) {
            $value = $this->setMutateAttribute($key, $value);
        } else {
            // Verificar se foi definido o cast do key
            if ($this->hasCast($key)) {
                $value = $this->setCast($key, $value);
            }
        }

        // Inserir documento e capturar ID
        if ($this->callbackSet instanceof \Closure) {
            $id = call_user_func_array($this->callbackSet, [$key, $value, $this->getId()]);
            if (! is_null($id)) {
                $this->id = $id;
            }
        }
    }
644283
private function setSessionInfo($key, $name, $val)
    {
        if ($this->has($key)) {
            $this->collection[$this->id_info][$key][$name] = $val;
        }
    }
67316
public function set ($name, $val, $validate = TRUE)
	{
		
		// If the attribute doesn't exists
		
		if (!$this->attributeExists ($name))
		{
			throw new Exception (get_called_class () . '->' . $name . ' attribute does not exist!');
		}
		
		// If attribute setter isn't set or is disabled
		
		if (!$this->attributeSet ($name))
		{
			throw new Exception (get_called_class () . '->' . $name . ' attribute set is disabled!');
		}
		
		// If we're validating the value
		
		if ($validate)
		{
			
			// Set friendly name if one exists
			
			$friendlyName	= isset (static::$attributes[$name]['name'])? static::$attributes[$name]['name'] : $name;
			
			// Validate it using the parser method
			
			$this->parser->Validate ($friendlyName, static::$attributes[$name], $val);
			
		}
		
		// Set the attribute value
		
		$this->attributeValues[$name]	= $val;
		
	}
200436
public function setAttribute( $attr, $val )
    {
        $def = $this->definition();
        $fields = $def["fields"];
        $functions = isset( $def["set_functions"] ) ? $def["set_functions"] : null;
        if ( isset( $fields[$attr] ) )
        {
            $attrName = $fields[$attr];
            if ( is_array( $attrName ) )
            {
                $attrName = $attrName['name'];
            }

            $oldValue = null;
            if ( isset( $this->$attrName ) )
                $oldValue = $this->$attrName;
            $this->$attrName = $val;
            if ( $oldValue === null ||
                 $oldValue !== $val )
                $this->setHasDirtyData( true );
        }
        else if ( isset( $functions[$attr] ) )
        {
            $functionName = $functions[$attr];
            $oldValue = $this->$functionName( $val );
            if ( $oldValue === null or $oldValue !== $val )
                $this->setHasDirtyData( true );
        }
        else
        {
            eZDebug::writeError( "Undefined attribute '$attr', cannot set",
                                 $def['class_name'] );
        }
    }