$db
$db : \Pop\Db\Adapter\AbstractAdapter
Database connection
Result class
$db : \Pop\Db\Adapter\AbstractAdapter
Database connection
$sql : \Pop\Db\Sql
SQL Object
$rowGateway : \Pop\Db\Gateway\Row
Row gateway
$tableGateway : \Pop\Db\Gateway\Table
Table gateway
__construct(\Pop\Db\Adapter\AbstractAdapter $db, string $table, mixed $keys, array $columns = null) : \Pop\Db\Record\Result
Constructor
Instantiate the database record result object.
\Pop\Db\Adapter\AbstractAdapter | $db | |
string | $table | |
mixed | $keys | |
array | $columns |
setDb(\Pop\Db\Adapter\AbstractAdapter $db) : \Pop\Db\Record\Result
Set DB connection
\Pop\Db\Adapter\AbstractAdapter | $db |
getDb() : \Pop\Db\Adapter\AbstractAdapter
Get the DB adapter
db() : \Pop\Db\Adapter\AbstractAdapter
Get DB adapter (alias)
setSql(\Pop\Db\Sql $sql) : \Pop\Db\Record\Result
Set the SQL object
\Pop\Db\Sql | $sql |
getSql() : \Pop\Db\Sql
Get the SQL object
sql() : \Pop\Db\Sql
Get the SQL object (alias)
findById(mixed $id, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Find record by ID method
mixed | $id | |
string | $resultsAs |
findBy(array $columns = null, array $options = null, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Find records by method
array | $columns | |
array | $options | |
string | $resultsAs |
findAll(array $options = null, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Find all records method
array | $options | |
string | $resultsAs |
execute(mixed $sql, mixed $params, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Method to execute a custom prepared SQL statement.
mixed | $sql | |
mixed | $params | |
string | $resultsAs |
query(mixed $sql, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Method to execute a custom SQL query.
mixed | $sql | |
string | $resultsAs |
setColumns(mixed $columns = null, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Set all the table column values at once.
mixed | $columns | |
string | $resultsAs |
setRows(array $rows = null, string $resultsAs = \Pop\Db\Record::ROW_AS_RESULT) : \Pop\Db\Record\Result
Set all the table rows at once
array | $rows | |
string | $resultsAs |
setTable(string $table) : \Pop\Db\Record\Result
Set the table
string | $table |
setPrimaryKeys(array $keys) : \Pop\Db\Record\Result
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