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

Public Member Functions

 __construct ()
 
 join ($c, bool $reset=false)
 
 union ($c, bool $reset=false)
 
 having ($c, bool $reset=false)
 
 order ($c, bool $reset=false)
 
 group ($c, bool $reset=false)
 
 groupBy ($c, bool $reset=false)
 
 limit ($limit)
 
 offset (int $offset)
 
 distinct (bool $distinct=true)
 
 statement ()
 
 select ()
 
 run ()
 
- 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

 $join
 
 $union
 
 $having
 
 $order
 
 $group
 
 $limit
 
 $offset
 
 $distinct
 
- Protected Attributes inherited from dcSqlStatement
const VERBOSE_SQL_ALIAS = false
 
 $con
 
 $syntax
 
 $_AS = ' '
 
 $columns = []
 
 $from = []
 
 $where = []
 
 $cond = []
 
 $sql = []
 

Detailed Description

Select Statement : small utility to build select queries

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Class constructor

Reimplemented from dcSqlStatement.

References distinct(), group(), having(), join(), limit(), offset(), and order().

Member Function Documentation

◆ join()

join (   $c,
bool  $reset = false 
)

Adds JOIN clause(s) (applied on first from item only)

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

References join().

Referenced by __construct(), join(), and statement().

◆ union()

union (   $c,
bool  $reset = false 
)

Adds UNION clause(s)

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

References union().

Referenced by union().

◆ having()

having (   $c,
bool  $reset = false 
)

Adds HAVING clause(s)

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

References having().

Referenced by __construct(), having(), and statement().

◆ order()

order (   $c,
bool  $reset = false 
)

Adds ORDER BY clause(s)

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

References order().

Referenced by __construct(), order(), and statement().

◆ group()

group (   $c,
bool  $reset = false 
)

Adds GROUP BY clause(s)

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

References group().

Referenced by __construct(), group(), groupBy(), and statement().

◆ groupBy()

groupBy (   $c,
bool  $reset = false 
)

group() alias

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

References group().

◆ limit()

limit (   $limit)

Defines the LIMIT for select

Parameters
mixed$limit(limit or [offset,limit])
Returns
self instance, enabling to chain calls

References $limit, $offset, limit(), and offset().

Referenced by __construct(), limit(), and statement().

◆ offset()

offset ( int  $offset)

Defines the OFFSET for select

Parameters
integer$offset
Returns
self instance, enabling to chain calls

References $offset, and offset().

Referenced by __construct(), limit(), offset(), and statement().

◆ distinct()

distinct ( bool  $distinct = true)

Defines the DISTINCT flag for select

Parameters
boolean$distinct
Returns
self instance, enabling to chain calls

References $distinct, and distinct().

Referenced by __construct(), distinct(), and statement().

◆ statement()

statement ( )

◆ select()

select ( )

Run the SQL select query and return result

Returns
dcRecord record

References dcSqlStatement\$sql, and statement().

Referenced by run().

◆ run()

run ( )

select() alias

Returns
dcRecord record

References select().

Field Documentation

◆ $join

$join
protected

◆ $union

$union
protected

◆ $having

$having
protected

◆ $order

$order
protected

◆ $group

$group
protected

◆ $limit

$limit
protected

Referenced by limit().

◆ $offset

$offset
protected

Referenced by limit(), and offset().

◆ $distinct

$distinct
protected

Referenced by distinct().


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