PHP Class Pop\Db\Record\Prepared

Author: Nick Sagona, III ([email protected])
Inheritance: extends AbstractRecord
Afficher le fichier Open project: nicksagona/PopPHP

Protected Properties

Свойство Type Description
$placeholder string Prepared statement parameter placeholder

Méthodes publiques

Méthode Description
__construct ( Db $db, array $options ) : Prepared Constructor
delete ( array $columnsPassed, array $columns = null ) : void Delete the database record.
execute ( string $sql, array $params = null ) : void Execute a custom prepared SQL query.
findAll ( string $order = null, array $columns = null, integer $limit = null, integer $offset = null ) : void Find all of the database rows by the column passed through the method argument.
findBy ( array $columns, string $order = null, integer $limit = null, integer $offset = null ) : void Find a database row by the column passed through the method argument.
findById ( mixed $id, integer $limit = null, integer $offset = null ) : void Find a database row by the primary ID passed through the method argument.
getCount ( array $columns = null ) : integer Get total count of records
query ( string $sql ) : void Execute a custom SQL query.
save ( array $columnsPassed, integer $type = Pop\Db\Record::INSERT ) : void Save the database record.

Méthodes protégées

Méthode Description
getPlaceholder ( string $column, integer $i = 1 ) : string Get the placeholder for a prepared statement
setResults ( ) : void Set the query results.

Method Details

__construct() public méthode

Instantiate the record prepared object.
public __construct ( Db $db, array $options ) : Prepared
$db Pop\Db\Db
$options array
Résultat Prepared

delete() public méthode

Delete the database record.
public delete ( array $columnsPassed, array $columns = null ) : void
$columnsPassed array
$columns array
Résultat void

execute() public méthode

Execute a custom prepared SQL query.
public execute ( string $sql, array $params = null ) : void
$sql string
$params array
Résultat void

findAll() public méthode

Find all of the database rows by the column passed through the method argument.
public findAll ( string $order = null, array $columns = null, integer $limit = null, integer $offset = null ) : void
$order string
$columns array
$limit integer
$offset integer
Résultat void

findBy() public méthode

Find a database row by the column passed through the method argument.
public findBy ( array $columns, string $order = null, integer $limit = null, integer $offset = null ) : void
$columns array
$order string
$limit integer
$offset integer
Résultat void

findById() public méthode

Find a database row by the primary ID passed through the method argument.
public findById ( mixed $id, integer $limit = null, integer $offset = null ) : void
$id mixed
$limit integer
$offset integer
Résultat void

getCount() public méthode

Get total count of records
public getCount ( array $columns = null ) : integer
$columns array
Résultat integer

getPlaceholder() protected méthode

Get the placeholder for a prepared statement
protected getPlaceholder ( string $column, integer $i = 1 ) : string
$column string
$i integer
Résultat string

query() public méthode

Execute a custom SQL query.
public query ( string $sql ) : void
$sql string
Résultat void

save() public méthode

Save the database record.
public save ( array $columnsPassed, integer $type = Pop\Db\Record::INSERT ) : void
$columnsPassed array
$type integer
Résultat void

setResults() protected méthode

Set the query results.
protected setResults ( ) : void
Résultat void

Property Details

$placeholder protected_oe property

Prepared statement parameter placeholder
protected string $placeholder
Résultat string