DB_dsql::set PHP Méthode

set() public méthode

Sets field value for INSERT or UPDATE statements.
public set ( string $field, mixed $value = UNDEFINED )
$field string Name of the field
$value mixed Value of the field
    public function set($field, $value = UNDEFINED)
    {
        if ($value === false) {
            throw $this->exception('Value "false" is not supported by SQL')->addMoreInfo('field', $field);
        }
        if (is_array($field)) {
            foreach ($field as $key => $value) {
                $this->set($key, $value);
            }
            return $this;
        }
        if ($value === UNDEFINED) {
            throw $this->exception('Specify value when calling set()');
        }
        $this->args['set'][$field] = $value;
        return $this;
    }