Class DibiFluent
dibi SQL builder via fluent interfaces. EXPERIMENTAL!
DibiObject | --DibiFluent
Implements interfaces:
| Constructor Summary | |
|---|---|
| public |
__construct
(DibiConnection $connection)
|
| Method Summary | |
|---|---|
| DibiFluent |
clause
(string $clause, [$remove =
FALSE])
Switch to a clause.
|
| int |
count
()
|
| DibiResult|int |
execute
([mixed $return =
NULL])
Generates and executes SQL query.
|
| DibiRow|FALSE |
fetch
()
Generates, executes SQL query and fetches the single row.
|
| array |
Fetches all records from table.
|
| array |
fetchAssoc
(string $assoc)
Fetches all records from table and returns associative tree.
|
| array |
Fetches all records from table like $key => $value pairs.
|
| mixed |
fetchSingle
()
Like fetch(), but returns only first field.
|
| string |
getCommand
()
Returns SQL command.
|
| DibiConnection |
Returns the dibi connection.
|
| bool |
getFlag
(string $flag)
Is a flag set?
|
| DibiResultIterator |
Required by the IteratorAggregate interface.
|
| DibiFluent |
removeClause
(string $clause)
Removes a clause.
|
| DibiFluent |
setFlag
(string $flag, [bool $value =
TRUE])
Change a SQL flag.
|
| bool |
test
([string $clause =
NULL])
Generates and prints SQL query or it's part.
|
| DibiDataSource |
toDataSource
()
|
| protected array |
Generates parameters for DibiTranslator.
|
| DibiFluent |
__call
(string $clause, array $args)
Appends new argument to the clause.
|
| void |
__clone
()
|
| string |
__toString
()
Returns SQL query.
|
| Constant Summary | |||
|---|---|---|---|
| bool | REMOVE |
FALSE |
line 23 |
| Variable Summary | ||||
|---|---|---|---|---|
| static array | $masks | array(
'SELECT' => array('SELECT', 'DISTINCT', 'FROM', 'WHERE', 'GROUP BY',
'HAVING',... |
line 26 |
|
| static array | $modifiers | array(
'SELECT' => '%n',
'FROM' => '%n',
'IN' => '%in',
'VALUES' => '%l',... |
line 35 default modifiers for arrays |
|
| static array | $separators | array(
'SELECT' => ',',
'FROM' => FALSE,
'WHERE' => 'AND',
'GROUP BY' =>... |
line 48 clauses separators |
|
| Constructor Details | ||||||
|---|---|---|---|---|---|---|
|
line 82 __constructpublic __construct (DibiConnection $connection)
|
||||||
| Method Details | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 176 clausepublic DibiFluent clause (string $clause, [$remove = Switch to a clause.
|
||||||||||||||||||
|
line 373 countpublic int count ()
|
||||||||||||||||||
|
line 269 executepublic DibiResult|int execute ([mixed $return = Generates and executes SQL query.
|
||||||||||||||||||
|
line 281 fetchpublic DibiRow|FALSE fetch () Generates, executes SQL query and fetches the single row.
|
||||||||||||||||||
|
line 313 fetchAllpublic array fetchAll ([int $offset = Fetches all records from table.
|
||||||||||||||||||
|
line 325 fetchAssocpublic array fetchAssoc (string $assoc) Fetches all records from table and returns associative tree.
|
||||||||||||||||||
|
line 338 fetchPairspublic array fetchPairs ([string $key = Fetches all records from table like $key => $value pairs.
|
||||||||||||||||||
|
line 296 fetchSinglepublic mixed fetchSingle () Like fetch(), but returns only first field.
|
||||||||||||||||||
|
line 241 getCommandpublic string getCommand () Returns SQL command.
|
||||||||||||||||||
|
line 252 getConnectionpublic DibiConnection getConnection () Returns the dibi connection.
|
||||||||||||||||||
|
line 230 getFlagpublic bool getFlag (string $flag) Is a flag set?
|
||||||||||||||||||
|
line 351 getIteratorpublic DibiResultIterator getIterator ([int $offset = Required by the IteratorAggregate interface.
|
||||||||||||||||||
|
line 198 removeClausepublic DibiFluent removeClause (string $clause) Removes a clause.
|
||||||||||||||||||
|
line 212 setFlagpublic DibiFluent setFlag (string $flag, [bool $value = Change a SQL flag.
|
||||||||||||||||||
|
line 363 testpublic bool test ([string $clause = Generates and prints SQL query or it's part.
|
||||||||||||||||||
|
line 389 toDataSourcepublic DibiDataSource toDataSource ()
|
||||||||||||||||||
|
line 412 _exportprotected array _export ([string $clause = Generates parameters for DibiTranslator.
|
||||||||||||||||||
|
line 95 __callpublic DibiFluent __call (string $clause, array $args) Appends new argument to the clause.
|
||||||||||||||||||
|
line 458 __clonepublic void __clone ()
|
||||||||||||||||||
|
line 400 __toStringpublic string __toString () Returns SQL query.
|
||||||||||||||||||