ROW_AS_ARRAY
ROW_AS_ARRAY
Data set result constants
Record class
$sql : \Pop\Db\Sql
SQL Object
$rowGateway : \Pop\Db\Gateway\Row
Row gateway
$tableGateway : \Pop\Db\Gateway\Table
Table gateway
__construct() : \Pop\Db\Record
Constructor
Instantiate the database record object.
Optional parameters are an array of values, db adapter, or a table name
setDb(\Pop\Db\Adapter\AbstractAdapter $db, string $prefix = null, boolean $isDefault = false) : void
Set DB connection
\Pop\Db\Adapter\AbstractAdapter | $db | |
string | $prefix | |
boolean | $isDefault |
db() : \Pop\Db\Adapter\AbstractAdapter
Get DB adapter
sql() : \Pop\Db\Sql
Get the SQL object
setSql(\Pop\Db\Sql $sql) : \Pop\Db\Record
Set the SQL object
\Pop\Db\Sql | $sql |
getSql() : \Pop\Db\Sql
Get the SQL object
findById(mixed $id, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Find by ID static method
mixed | $id | |
string | $resultsAs |
findBy(array $columns = null, array $options = null, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Find by static method
array | $columns | |
array | $options | |
string | $resultsAs |
findAll(array $options = null, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Find all static method
array | $options | |
string | $resultsAs |
execute(mixed $sql, mixed $params, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Static method to execute a custom prepared SQL statement.
mixed | $sql | |
mixed | $params | |
string | $resultsAs |
query(mixed $sql, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Static method to execute a custom SQL query.
mixed | $sql | |
string | $resultsAs |
findRecordById(mixed $id, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Find record by ID method
mixed | $id | |
string | $resultsAs |
findRecordsBy(array $columns = null, array $options = null, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Find records by method
array | $columns | |
array | $options | |
string | $resultsAs |
findAllRecords(array $options = null, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Find all records method
array | $options | |
string | $resultsAs |
executeStatement(mixed $sql, mixed $params, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Method to execute a custom prepared SQL statement.
mixed | $sql | |
mixed | $params | |
string | $resultsAs |
executeQuery(mixed $sql, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Method to execute a custom SQL query.
mixed | $sql | |
string | $resultsAs |
setColumns(mixed $columns = null, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Set all the table column values at once.
mixed | $columns | |
string | $resultsAs |
setRows(array $rows = null, string $resultsAs = 'ROW_AS_RECORD') : \Pop\Db\Record
Set all the table rows at once
array | $rows | |
string | $resultsAs |
setPrefix(string $prefix) : \Pop\Db\Record
Set the table prefix
string | $prefix |
setTable(string $table) : \Pop\Db\Record
Set the table
string | $table |
setTableFromClassName(string $class) : \Pop\Db\Record
Set the table from a class name
string | $class |
setPrimaryKeys(array $keys) : \Pop\Db\Record
Set the primary keys
array | $keys |
rg() : \Pop\Db\Gateway\Row
Get the row gateway object
tg() : \Pop\Db\Gateway\Table
Get the table gateway object