PHP Interface phpDataMapper_Adapter_Interface, phpDataMapper

Show file Open project: vlucas/phpDataMapper

Public Methods

Method Description
__construct ( mixed $host, string $datasource = null, string $username = null, string $password = null, array $options = [] ) : void
connection ( ) Get database connection
create ( $source, array $data ) Insert entity
createDatabase ( $database ) Create a database Will throw errors if user does not have proper permissions
dateFormat ( ) Get database DATE format for PHP date() function
dateTimeFormat ( ) Get database full DATETIME for PHP date() function
delete ( $source, array $where ) Delete entity
dropDatabase ( $database ) Drop an entire database Destructive and dangerous - drops entire table and all data Will throw errors if user does not have proper permissions
dropDatasource ( $source ) Drop/delete data source (table for SQL) Destructive and dangerous - drops entire data source and all data
escape ( string $string ) Escape/quote direct user input
read ( phpDataMapper_Query $query ) Read from data source using given query object
timeFormat ( ) Get database TIME format for PHP date() function
truncateDatasource ( $source ) Truncate data source (table for SQL) Should delete all rows and reset serial/auto_increment keys to 0
update ( $source, array $data, array $where = [] ) Update entity

Method Details

__construct() public method

public __construct ( mixed $host, string $datasource = null, string $username = null, string $password = null, array $options = [] ) : void
$host mixed Host string or pre-existing PDO object
$datasource string Optional if $host is PDO object
$username string Optional if $host is PDO object
$password string Optional if $host is PDO object
$options array
return void

connection() public method

Get database connection
public connection ( )

create() public method

Insert entity
public create ( $source, array $data )
$data array

createDatabase() public method

Create a database Will throw errors if user does not have proper permissions
public createDatabase ( $database )

dateFormat() public method

Get database DATE format for PHP date() function
public dateFormat ( )

dateTimeFormat() public method

Get database full DATETIME for PHP date() function
public dateTimeFormat ( )

delete() public method

Delete entity
public delete ( $source, array $where )
$where array

dropDatabase() public method

Drop an entire database Destructive and dangerous - drops entire table and all data Will throw errors if user does not have proper permissions
public dropDatabase ( $database )

dropDatasource() public method

Drop/delete data source (table for SQL) Destructive and dangerous - drops entire data source and all data
public dropDatasource ( $source )

escape() public method

Escape/quote direct user input
public escape ( string $string )
$string string

read() public method

Read from data source using given query object
public read ( phpDataMapper_Query $query )
$query phpDataMapper_Query

timeFormat() public method

Get database TIME format for PHP date() function
public timeFormat ( )

truncateDatasource() public method

Truncate data source (table for SQL) Should delete all rows and reset serial/auto_increment keys to 0
public truncateDatasource ( $source )

update() public method

Update entity
public update ( $source, array $data, array $where = [] )
$data array
$where array