DataSource
class DataSource implements IDataSource
Default implementation of IDataSource.
Methods
Selects columns to query.
Adds conditions to query.
Selects columns to order by.
Limits number of rows.
No description
No description
Generates, executes SQL query and fetches the single row.
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 33
__construct(string $sql, Connection $connection)
No description
at line 47
DataSource
select(string|array $col, string|null $as = null)
Selects columns to query.
at line 63
DataSource
where($cond)
Adds conditions to query.
at line 77
DataSource
orderBy(string|array $row, string $direction = 'ASC')
Selects columns to order by.
at line 93
DataSource
applyLimit(int $limit, int|null $offset = null)
Limits number of rows.
at line 102
final Connection
getConnection()
No description
at line 114
Result
getResult()
Returns (and queries) Result.
at line 124
ResultIterator
getIterator()
No description
at line 133
Row|null
fetch()
Generates, executes SQL query and fetches the single row.
at line 143
mixed
fetchSingle()
Like fetch(), but returns only first field.
at line 152
array
fetchAll()
Fetches all records from table.
at line 161
array
fetchAssoc(string $assoc)
Fetches all records from table and returns associative tree.
at line 170
array
fetchPairs(string|null $key = null, string|null $value = null)
Fetches all records from table like $key => $value pairs.
at line 179
void
release()
Discards the internal cache.
at line 191
Fluent
toFluent()
Returns this data source wrapped in Fluent object.
at line 200
DataSource
toDataSource()
Returns this data source wrapped in DataSource object.
at line 209
string
__toString()
Returns SQL query.
at line 233
int
count()
Returns the number of rows in a given data source.
at line 250
int
getTotalCount()
Returns the number of rows in a given data source.