DataSource
class DataSource implements IDataSource
Default implementation of IDataSource for dibi.
Methods
Selects columns to query.
Adds conditions to query.
Selects columns to order by.
Limits number of rows.
Returns the dibi connection.
No description
Like fetch(), but returns only first field.
Fetches all records from table.
Fetches all records from table and returns associative tree.
Fetches all records from table like $key => $value pairs.
Discards the internal cache.
Returns this data source wrapped in DataSource object.
Returns SQL query.
Returns the number of rows in a given data source.
Returns the number of rows in a given data source.
Details
at line 54
__construct($sql, Connection $connection)
No description
at line 71
DataSource
select($col, $as = NULL)
Selects columns to query.
at line 88
DataSource
where($cond)
Adds conditions to query.
at line 107
DataSource
orderBy($row, $sorting = 'ASC')
Selects columns to order by.
at line 125
DataSource
applyLimit($limit, $offset = NULL)
Limits number of rows.
at line 138
final Connection
getConnection()
Returns the dibi connection.
at line 151
Result
getResult()
Returns (and queries) Result.
at line 163
ResultIterator
getIterator()
No description
at line 173
Row|false
fetch()
Generates, executes SQL query and fetches the single row.
at line 183
mixed
fetchSingle()
Like fetch(), but returns only first field.
at line 193
array
fetchAll()
Fetches all records from table.
at line 204
array
fetchAssoc($assoc)
Fetches all records from table and returns associative tree.
at line 216
array
fetchPairs($key = NULL, $value = NULL)
Fetches all records from table like $key => $value pairs.
at line 226
void
release()
Discards the internal cache.
at line 239
Fluent
toFluent()
Returns this data source wrapped in Fluent object.
at line 249
DataSource
toDataSource()
Returns this data source wrapped in DataSource object.
at line 259
string
__toString()
Returns SQL query.
at line 282
int
count()
Returns the number of rows in a given data source.
at line 299
int
getTotalCount()
Returns the number of rows in a given data source.
Traits
Better OOP experience.