PHP Interface Spot\Adapter\AdapterInterface

Datei anzeigen Open project: vlucas/spot

Public Methods

Method Description
__construct ( mixed $dsn, array $options = [] ) : void
beginTransaction ( ) Begin transaction
commit ( ) Commit transaction
connection ( ) Get database connection
count ( Query $query, array $options = [] ) * Count number of rows in source based on conditions
create ( $source, array $data, array $options = [] ) Insert entity
createDatabase ( $database ) Create a database Will throw errors if user does not have proper permissions
date ( $format = null ) Get date in format that adapter understands for queries
dateFormat ( ) Get database DATE format for PHP date() function
dateTime ( $format = null ) Get datetime in format that adapter understands for queries
dateTimeFormat ( ) Get database full DATETIME for PHP date() function
delete ( $source, array $where, array $options = [] ) 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 ( Query $query, array $options = [] ) Read from data source using given query object
rollback ( ) Rollback transaction
time ( $format = null ) Get time in format that adapter understands for queries
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 = [], array $options = [] ) Update entity

Method Details

__construct() public method

public __construct ( mixed $dsn, array $options = [] ) : void
$dsn mixed DSN string or pre-existing raw connection object to be used instead of instantiating a new one (like PDO or Mongo, etc)
$options array
return void

beginTransaction() public method

Begin transaction
public beginTransaction ( )

commit() public method

Commit transaction
public commit ( )

connection() public method

Get database connection
public connection ( )

count() public method

* Count number of rows in source based on conditions
public count ( Query $query, array $options = [] )
$query Spot\Query
$options array

create() public method

Insert entity
public create ( $source, array $data, array $options = [] )
$data array
$options array

createDatabase() public method

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

date() public method

Get date in format that adapter understands for queries
public date ( $format = null )

dateFormat() public method

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

dateTime() public method

Get datetime in format that adapter understands for queries
public dateTime ( $format = null )

dateTimeFormat() public method

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

delete() public method

Delete entity
public delete ( $source, array $where, array $options = [] )
$where array
$options 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 ( Query $query, array $options = [] )
$query Spot\Query
$options array

rollback() public method

Rollback transaction
public rollback ( )

time() public method

Get time in format that adapter understands for queries
public time ( $format = null )

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 = [], array $options = [] )
$data array
$where array
$options array