Class DibiDataSource
Default implementation of IDataSource for dibi.
DibiObject | --DibiDataSource
Implements interfaces:
| Constructor Summary | |
|---|---|
| public |
__construct
(string $sql, DibiConnection $connection)
|
| Method Summary | |
|---|---|
| DibiDataSource |
applyLimit
(int $limit, [int $offset =
NULL])
Limits number of rows.
|
| int |
count
()
Returns the number of rows in a given data source.
|
| DibiRow|FALSE |
fetch
()
Generates, executes SQL query and fetches the single row.
|
| array |
fetchAll
()
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.
|
| DibiConnection |
Returns the dibi connection.
|
| DibiResultIterator |
getIterator
()
|
| DibiResult |
getResult
()
Returns (and queries) DibiResult.
|
| int |
Returns the number of rows in a given data source.
|
| DibiDataSource |
orderBy
(string|array $row, [string $sorting =
'ASC'])
Selects columns to order by.
|
| void |
release
()
Discards the internal cache.
|
| DibiDataSource |
select
(string|array $col, [string $as =
NULL])
Selects columns to query.
|
| DibiDataSource |
toDataSource
()
Returns this data source wrapped in DibiDataSource object.
|
| DibiFluent |
toFluent
()
Returns this data source wrapped in DibiFluent object.
|
| DibiDataSource |
where
(mixed $cond)
Adds conditions to query.
|
| string |
__toString
()
Returns SQL query.
|
| Constructor Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
line 59 __constructpublic __construct (string $sql, DibiConnection $connection)
|
|||||||||
| Method Details | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 134 applyLimitpublic DibiDataSource applyLimit (int $limit, [int $offset = Limits number of rows.
|
|||||||||||||||
|
line 303 countpublic int count () Returns the number of rows in a given data source.
|
|||||||||||||||
|
line 187 fetchpublic DibiRow|FALSE fetch () Generates, executes SQL query and fetches the single row.
|
|||||||||||||||
|
line 209 fetchAllpublic array fetchAll () Fetches all records from table.
|
|||||||||||||||
|
line 221 fetchAssocpublic array fetchAssoc (string $assoc) Fetches all records from table and returns associative tree.
|
|||||||||||||||
|
line 234 fetchPairspublic array fetchPairs ([string $key = Fetches all records from table like $key => $value pairs.
|
|||||||||||||||
|
line 198 fetchSinglepublic mixed fetchSingle () Like fetch(), but returns only first field.
|
|||||||||||||||
|
line 148 getConnectionpublic DibiConnection getConnection () Returns the dibi connection.
|
|||||||||||||||
|
line 176 getIteratorpublic DibiResultIterator getIterator ()
|
|||||||||||||||
|
line 163 getResultpublic DibiResult getResult () Returns (and queries) DibiResult.
|
|||||||||||||||
|
line 321 getTotalCountpublic int getTotalCount () Returns the number of rows in a given data source.
|
|||||||||||||||
|
line 115 orderBypublic DibiDataSource orderBy (string|array $row, [string $sorting = Selects columns to order by.
|
|||||||||||||||
|
line 245 releasepublic void release () Discards the internal cache.
|
|||||||||||||||
|
line 77 selectpublic DibiDataSource select (string|array $col, [string $as = Selects columns to query.
|
|||||||||||||||
|
line 271 toDataSourcepublic DibiDataSource toDataSource () Returns this data source wrapped in DibiDataSource object.
|
|||||||||||||||
|
line 260 toFluentpublic DibiFluent toFluent () Returns this data source wrapped in DibiFluent object.
|
|||||||||||||||
|
line 95 wherepublic DibiDataSource where (mixed $cond) Adds conditions to query.
|
|||||||||||||||
|
line 282 __toStringpublic string __toString () Returns SQL query.
|
|||||||||||||||