Class DibiDataSource
Default implementation of IDataSource for dibi.
- DibiObject
-
DibiDataSource implements IDataSource, Traversable, IteratorAggregate, Countable
public
|
#
__construct(
string
$sql,
DibiConnection
$connection
)
Parameters$sql string SQL command or table or view name, as data source$connection DibiConnection connection |
public
DibiDataSource
|
#
select(
string|array
$col,
string
$as = NULL
)
Selects columns to query. Selects columns to query. Parameters$col string|array column name or array of column names$as string column aliasReturnsDibiDataSource provides a fluent interface
|
public
DibiDataSource
|
#
where(
mixed
$cond
)
Adds conditions to query. Adds conditions to query. Parameters$cond mixed conditionsReturnsDibiDataSource provides a fluent interface
|
public
DibiDataSource
|
#
orderBy(
string|array
$row,
string
$sorting = 'ASC'
)
Selects columns to order by. Selects columns to order by. Parameters$row string|array column name or array of column names$sorting string sorting directionReturnsDibiDataSource provides a fluent interface
|
public
DibiDataSource
|
#
applyLimit(
int
$limit,
int
$offset = NULL
)
Limits number of rows. Limits number of rows. Parameters$limit int limit$offset int offsetReturnsDibiDataSource provides a fluent interface
|
final public
DibiConnection
|
#
getConnection(
)
Returns the dibi connection. Returns the dibi connection. |
public
DibiResult
|
#
getResult(
)
Returns (and queries) DibiResult. Returns (and queries) DibiResult. |
public
DibiResultIterator
|
#
getIterator(
)
Implementation of |
public
DibiRow|FALSE
|
#
fetch(
)
Generates, executes SQL query and fetches the single row. Generates, executes SQL query and fetches the single row. ReturnsDibiRow|FALSE array on success, FALSE if no next record
|
public
mixed
|
#
fetchSingle(
)
Like fetch(), but returns only first field. Like fetch(), but returns only first field. Returnsmixed value on success, FALSE if no next record
|
public
array
|
#
fetchAll(
)
Fetches all records from table. Fetches all records from table. |
public
array
|
#
fetchAssoc(
string
$assoc
)
Fetches all records from table and returns associative tree. Fetches all records from table and returns associative tree. Parameters$assoc string associative descriptor |
public
array
|
#
fetchPairs(
string
$key = NULL,
string
$value = NULL
)
Fetches all records from table like $key ⇒ $value pairs. Fetches all records from table like $key ⇒ $value pairs. Parameters$key string associative key$value string value |
public
void
|
#
release(
)
Discards the internal cache. Discards the internal cache. |
public
DibiFluent
|
#
toFluent(
)
Returns this data source wrapped in DibiFluent object. Returns this data source wrapped in DibiFluent object. |
public
DibiDataSource
|
#
toDataSource(
)
Returns this data source wrapped in DibiDataSource object. Returns this data source wrapped in DibiDataSource object. |
public
string
|
#
__toString(
)
Returns SQL query. Returns SQL query. |
public
int
|
#
count(
)
Returns the number of rows in a given data source. |
public
int
|
#
getTotalCount(
)
Returns the number of rows in a given data source. Returns the number of rows in a given data source. |