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 64 __constructpublic __construct (string $sql, DibiConnection $connection)
|
|||||||||
| Method Details | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 139 applyLimitpublic DibiDataSource applyLimit (int $limit, [int $offset = Limits number of rows.
|
|||||||||||||||
|
line 308 countpublic int count () Returns the number of rows in a given data source.
|
|||||||||||||||
|
line 192 fetchpublic DibiRow|FALSE fetch () Generates, executes SQL query and fetches the single row.
|
|||||||||||||||
|
line 214 fetchAllpublic array fetchAll () Fetches all records from table.
|
|||||||||||||||
|
line 226 fetchAssocpublic array fetchAssoc (string $assoc) Fetches all records from table and returns associative tree.
|
|||||||||||||||
|
line 239 fetchPairspublic array fetchPairs ([string $key = Fetches all records from table like $key => $value pairs.
|
|||||||||||||||
|
line 203 fetchSinglepublic mixed fetchSingle () Like fetch(), but returns only first field.
|
|||||||||||||||
|
line 153 getConnectionpublic DibiConnection getConnection () Returns the dibi connection.
|
|||||||||||||||
|
line 181 getIteratorpublic DibiResultIterator getIterator ()
|
|||||||||||||||
|
line 168 getResultpublic DibiResult getResult () Returns (and queries) DibiResult.
|
|||||||||||||||
|
line 326 getTotalCountpublic int getTotalCount () Returns the number of rows in a given data source.
|
|||||||||||||||
|
line 120 orderBypublic DibiDataSource orderBy (string|array $row, [string $sorting = Selects columns to order by.
|
|||||||||||||||
|
line 250 releasepublic void release () Discards the internal cache.
|
|||||||||||||||
|
line 82 selectpublic DibiDataSource select (string|array $col, [string $as = Selects columns to query.
|
|||||||||||||||
|
line 276 toDataSourcepublic DibiDataSource toDataSource () Returns this data source wrapped in DibiDataSource object.
|
|||||||||||||||
|
line 265 toFluentpublic DibiFluent toFluent () Returns this data source wrapped in DibiFluent object.
|
|||||||||||||||
|
line 100 wherepublic DibiDataSource where (mixed $cond) Adds conditions to query.
|
|||||||||||||||
|
line 287 __toStringpublic string __toString () Returns SQL query.
|
|||||||||||||||