PHP Class Base\Base

Exibir arquivo Open project: erusev/base Class Usage Examples

Public Properties

Property Type Description
$fkEnding string The ending of FK names.

Public Methods

Method Description
__construct ( string $dsn, string $username = null, string $password = null, array $options = [] ) Takes the same parameters as the PDO constructor.
createItem ( string $table, array $Data ) : integer
deleteItem ( string $table, integer $id ) : integer
execute ( string $statement, array $parameters = [] ) : PDOStatemen\PDOStatement
find ( string $table ) : base\Collection
lastId ( ) : integer
pdo ( ) : PD\PDO
read ( string $statement, array $parameters = [] ) : array
readField ( string $statement, array $parameters = [] ) : array
readFields ( string $statement, array $parameters = [] ) : array
readItem ( string $table, integer $id ) : array
readRecord ( string $statement, array $parameters = [] ) : array
update ( string $statement, array $parameters = [] ) : integer
updateItem ( string $table, integer $id, array $Data ) : integer

Method Details

__construct() public method

Takes the same parameters as the PDO constructor.
public __construct ( string $dsn, string $username = null, string $password = null, array $options = [] )
$dsn string
$username string [optional]
$password string [optional]
$options array [optional]

createItem() public method

public createItem ( string $table, array $Data ) : integer
$table string
$Data array
return integer

deleteItem() public method

public deleteItem ( string $table, integer $id ) : integer
$table string
$id integer
return integer

execute() public method

public execute ( string $statement, array $parameters = [] ) : PDOStatemen\PDOStatement
$statement string
$parameters array
return PDOStatemen\PDOStatement

find() public method

public find ( string $table ) : base\Collection
$table string
return base\Collection

lastId() public method

public lastId ( ) : integer
return integer

pdo() public method

public pdo ( ) : PD\PDO
return PD\PDO

read() public method

public read ( string $statement, array $parameters = [] ) : array
$statement string
$parameters array
return array

readField() public method

public readField ( string $statement, array $parameters = [] ) : array
$statement string
$parameters array
return array

readFields() public method

public readFields ( string $statement, array $parameters = [] ) : array
$statement string
$parameters array
return array

readItem() public method

public readItem ( string $table, integer $id ) : array
$table string
$id integer
return array

readRecord() public method

public readRecord ( string $statement, array $parameters = [] ) : array
$statement string
$parameters array
return array

update() public method

public update ( string $statement, array $parameters = [] ) : integer
$statement string
$parameters array
return integer

updateItem() public method

public updateItem ( string $table, integer $id, array $Data ) : integer
$table string
$id integer
$Data array
return integer

Property Details

$fkEnding public_oe property

The ending of FK names.
public string $fkEnding
return string