Dotclear 2.24
Loading...
Searching...
No Matches
dcUpdateStatement Class Reference
Inheritance diagram for dcUpdateStatement:
dcSqlStatement

Public Member Functions

 __construct ()
 
 reference ($c, bool $reset=false)
 
 ref ($c, bool $reset=false)
 
 set ($c, bool $reset=false)
 
 sets ($c, bool $reset=false)
 
 whereStatement ()
 
 statement ()
 
 update (?cursor $cur=null)
 
 run (?cursor $cur=null)
 
- Public Member Functions inherited from dcSqlStatement
 __construct ()
 
 __get (string $property)
 
 __set (string $property, $value)
 
 __isset (string $property)
 
 __unset (string $property)
 
 __invoke ()
 
 statement ()
 
 columns ($c, bool $reset=false)
 
 fields ($c, bool $reset=false)
 
 column ($c, bool $reset=false)
 
 field ($c, bool $reset=false)
 
 from ($c, bool $reset=false, bool $first=false)
 
 where ($c, bool $reset=false)
 
 on ($c, bool $reset=false)
 
 cond ($c, bool $reset=false)
 
 and ($c, bool $reset=false)
 
 andGroup ($c)
 
 or ($c, bool $reset=false)
 
 orGroup ($c)
 
 sql ($c, bool $reset=false)
 
 escape (string $value)
 
 quote ($value, bool $escape=true)
 
 alias (string $name, string $alias)
 
 as (string $name, string $alias)
 
 in ($list, string $cast='')
 
 inSelect (string $field, dcSelectStatement $sql)
 
 dateFormat (string $field, string $pattern)
 
 like (string $field, string $pattern)
 
 regexp (string $value)
 
 unique (string $field)
 
 count (string $field, ?string $as=null, bool $unique=false)
 
 avg (string $field, ?string $as=null)
 
 max (string $field, ?string $as=null)
 
 min (string $field, ?string $as=null)
 
 sum (string $field, ?string $as=null)
 
 isNull (string $field)
 
 isNotNull (string $field)
 
 isSame (string $local, string $external)
 
 compare (string $external, bool $trigger_error=false, bool $dump=false, bool $print=false)
 

Protected Attributes

 $set
 
- Protected Attributes inherited from dcSqlStatement
const VERBOSE_SQL_ALIAS = false
 
 $con
 
 $syntax
 
 $_AS = ' '
 
 $columns = []
 
 $from = []
 
 $where = []
 
 $cond = []
 
 $sql = []
 

Detailed Description

Update Statement : small utility to build update queries

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Class constructor

Reimplemented from dcSqlStatement.

Member Function Documentation

◆ reference()

reference (   $c,
bool  $reset = false 
)

from() alias

Parameters
mixed$cthe reference clause(s)
boolean$resetreset previous reference first
Returns
self instance, enabling to chain calls

References dcSqlStatement\from().

◆ ref()

ref (   $c,
bool  $reset = false 
)

from() alias

Parameters
mixed$cthe reference clause(s)
boolean$resetreset previous reference first
Returns
self instance, enabling to chain calls

References dcSqlStatement\from().

◆ set()

set (   $c,
bool  $reset = false 
)

Adds update value(s)

Parameters
mixed$cthe udpate values(s)
boolean$resetreset previous update value(s) first
Returns
self instance, enabling to chain calls

◆ sets()

sets (   $c,
bool  $reset = false 
)

set() alias

Parameters
mixed$cthe update value(s)
boolean$resetreset previous update value(s) first
Returns
self instance, enabling to chain calls

◆ whereStatement()

whereStatement ( )

Returns the WHERE part of update statement

Useful to construct the where clause used with cursor->update() method

Returns
string The where part of update statement

References dcCore\app(), dcSqlStatement\cond(), dcSqlStatement\count(), dcSqlStatement\sql(), and dcSqlStatement\where().

Referenced by statement(), and update().

◆ statement()

statement ( )

Returns the update statement

Returns
string the statement

Reimplemented from dcSqlStatement.

References dcCore\app(), dcSqlStatement\count(), dcSqlStatement\from(), and whereStatement().

Referenced by update().

◆ update()

update ( ?cursor  $cur = null)

Run the SQL update query

Parameters
cursor | null$curThe cursor
Returns
bool

References dcSqlStatement\$sql, statement(), and whereStatement().

Referenced by run().

◆ run()

run ( ?cursor  $cur = null)

update() alias

Parameters
cursor | null$curThe cursor
Returns
bool

References update().

Field Documentation

◆ $set

$set
protected

The documentation for this class was generated from the following file: