AS_ARRAY
AS_ARRAY
Constants to set individual row data type
Encoded record class
$rowGateway : \Pop\Db\Gateway\Row
Row gateway
$tableGateway : \Pop\Db\Gateway\Table
Table gateway
setDb(\Pop\Db\Adapter\AbstractAdapter $db, string $prefix = null, boolean $isDefault = false) : void
Set DB adapter
| \Pop\Db\Adapter\AbstractAdapter | $db | |
| string | $prefix | |
| boolean | $isDefault |
setDefaultDb(\Pop\Db\Adapter\AbstractAdapter $db) : void
Set DB adapter
| \Pop\Db\Adapter\AbstractAdapter | $db |
getDb() : \Pop\Db\Adapter\AbstractAdapter
Get DB adapter
db() : \Pop\Db\Adapter\AbstractAdapter
Get DB adapter (alias)
getSql() : \Pop\Db\Sql
Get SQL builder
sql() : \Pop\Db\Sql
Get SQL builder (alias)
findById(mixed $id) : static|\Pop\Db\Record\Collection
Find by ID static method
| mixed | $id |
findBy(array $columns = null, array $options = null, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection
Find by static method
| array | $columns | |
| array | $options | |
| string | $resultAs |
findByOrCreate(array $columns = null, array $options = null, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection|\Pop\Db\Record
Find by or create static method
| array | $columns | |
| array | $options | |
| string | $resultAs |
findAll(array $options = null, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection
Find all static method
| array | $options | |
| string | $resultAs |
execute(mixed $sql, array $params, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection
Static method to execute a custom prepared SQL statement.
| mixed | $sql | |
| array | $params | |
| string | $resultAs |
query(mixed $sql, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection
Static method to execute a custom SQL query.
| mixed | $sql | |
| string | $resultAs |
getById(mixed $id) : static|\Pop\Db\Record\Collection
Get by ID method
| mixed | $id |
getBy(array $columns = null, array $options = null, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection
Get by method
| array | $columns | |
| array | $options | |
| string | $resultAs |
getAll(array $options = null, string $resultAs = \Pop\Db\Record::AS_RECORD) : \Pop\Db\Record\Collection
Get all method
| array | $options | |
| string | $resultAs |
hasOne(string $foreignTable, string $foreignKey, array $options = null, boolean $eager = false) : \Pop\Db\Record|\Pop\Db\Record\Relationships\HasOne
Has one relationship
| string | $foreignTable | |
| string | $foreignKey | |
| array | $options | |
| boolean | $eager |
hasOneOf(string $foreignTable, string $foreignKey, array $options = null, boolean $eager = false) : \Pop\Db\Record|\Pop\Db\Record\Relationships\HasOne
Has one of relationship
| string | $foreignTable | |
| string | $foreignKey | |
| array | $options | |
| boolean | $eager |
hasMany(string $foreignTable, string $foreignKey, array $options = null, boolean $eager = false) : \Pop\Db\Record\Collection|\Pop\Db\Record\Relationships\HasMany
Has many relationship
| string | $foreignTable | |
| string | $foreignKey | |
| array | $options | |
| boolean | $eager |
belongsTo(string $foreignTable, string $foreignKey, array $options = null, boolean $eager = false) : \Pop\Db\Record|\Pop\Db\Record\Relationships\BelongsTo
Belongs to relationship
| string | $foreignTable | |
| string | $foreignKey | |
| array | $options | |
| boolean | $eager |
setTable(string $table) : \Pop\Db\Record\AbstractRecord
Set the table
| string | $table |
setPrefix(string $prefix) : \Pop\Db\Record\AbstractRecord
Set the table prefix
| string | $prefix |
setPrimaryKeys(array $keys) : \Pop\Db\Record\AbstractRecord
Set the primary keys
| array | $keys |
addWith(string $name, array $options = null) : \Pop\Db\Record\AbstractRecord
Set with relationships
| string | $name | |
| array | $options |
getWithRelationships(boolean $eager = true) : \Pop\Db\Record\AbstractRecord
Get with relationships
| boolean | $eager |
setRelationship(string $name, mixed $relationship) : \Pop\Db\Record\AbstractRecord
Set relationship
| string | $name | |
| mixed | $relationship |
getRowGateway() : \Pop\Db\Gateway\Row
Get the row gateway
getTableGateway() : \Pop\Db\Gateway\Table
Get the table gateway
getRows() : \Pop\Db\Record\Collection
Get the rows
rows() : \Pop\Db\Record\Collection
Get the rows (alias method)
setColumns(mixed $columns = null) : \Pop\Db\Record\Encoded
Set all the table column values at once
| mixed | $columns |
setRows(array $rows = null, string $resultAs = \Pop\Db\Record\AbstractRecord::AS_RECORD) : \Pop\Db\Record\AbstractRecord
Set all the table rows at once
| array | $rows | |
| string | $resultAs |