PHP Trait Bluz\Db\Query\Traits\Set

Author: Anton Shevchuk
Show file Open project: bluzphp/framework

Public Methods

Method Description
set ( string $key, string $value ) Set key-value pair
setArray ( array $data ) Set data from array

Method Details

set() public method

Sets a new value for a column in a insert/update query $ub = new UpdateBuilder(); $ub ->update('users') ->set('password', md5('password')) ->where('id = ?');
public set ( string $key, string $value )
$key string The column to set
$value string The value, expression, placeholder, etc

setArray() public method

$ub = new UpdateBuilder(); $ub ->update('users') ->setArray([ 'password' => md5('password') 'updated' => date('Y-m-d H:i:s') ]) ->where('u.id = ?');
public setArray ( array $data )
$data array