PHP Class Spot\Query\Resolver

ファイルを表示 Open project: vlucas/spot2

Protected Properties

Property Type Description
$_noQuote
$mapper Spot\Mapper

Public Methods

Method Description
__construct ( Mapper $mapper ) Constructor Method
create ( string $table, array $data ) Create new row object with set properties
dataWithFieldAliasMappings ( array $data ) Taken given field name/value inputs and map them to their aliased names
dropTable ( string $table ) : boolean Drop Table
escapeIdentifier ( string $identifier ) : string Escape/quote identifier
exec ( Query $query ) : Doctrine\DBAL\Driver\Statement | integer Execute provided query and return result
migrate ( ) : boolean Migrate table structure changes to database
migrateCreateSchema ( ) : Doctrine\DBAL\Schema\Schema Migrate create schema
noQuote ( boolean $noQuote = true ) Set field and value quoting on/off - maily used for testing output SQL since quoting is different per platform
read ( Query $query ) : Collection Find records with custom SQL query
trimSchemaName ( string $identifier ) : string Trim a leading schema name separated by a dot if present
truncate ( string $table, boolean $cascade = false ) Truncate Table
update ( string $table, array $data, array $where ) Update

Protected Methods

Method Description
addForeignKeys ( Doctrine\DBAL\Schema\Table $table ) : Doctrine\DBAL\Schema\Table Add foreign keys from BelongsTo relations to the table schema

Method Details

__construct() public method

Constructor Method
public __construct ( Mapper $mapper )
$mapper Spot\Mapper

addForeignKeys() protected method

Add foreign keys from BelongsTo relations to the table schema
protected addForeignKeys ( Doctrine\DBAL\Schema\Table $table ) : Doctrine\DBAL\Schema\Table
$table Doctrine\DBAL\Schema\Table
return Doctrine\DBAL\Schema\Table

create() public method

Create new row object with set properties
public create ( string $table, array $data )
$table string Table name
$data array Array of data to save in 'field' => 'value' format

dataWithFieldAliasMappings() public method

Taken given field name/value inputs and map them to their aliased names
public dataWithFieldAliasMappings ( array $data )
$data array

dropTable() public method

Drop Table
public dropTable ( string $table ) : boolean
$table string Table name
return boolean

escapeIdentifier() public method

Escape/quote identifier
public escapeIdentifier ( string $identifier ) : string
$identifier string
return string

exec() public method

Execute provided query and return result
public exec ( Query $query ) : Doctrine\DBAL\Driver\Statement | integer
$query Spot\Query SQL query to execute
return Doctrine\DBAL\Driver\Statement | integer

migrate() public method

Migrate table structure changes to database
public migrate ( ) : boolean
return boolean

migrateCreateSchema() public method

Migrate create schema
public migrateCreateSchema ( ) : Doctrine\DBAL\Schema\Schema
return Doctrine\DBAL\Schema\Schema

noQuote() public method

Set field and value quoting on/off - maily used for testing output SQL since quoting is different per platform
public noQuote ( boolean $noQuote = true )
$noQuote boolean

read() public method

Find records with custom SQL query
public read ( Query $query ) : Collection
$query Spot\Query SQL query to execute
return Spot\Entity\Collection

trimSchemaName() public method

Trim a leading schema name separated by a dot if present
public trimSchemaName ( string $identifier ) : string
$identifier string
return string

truncate() public method

Truncate Table
public truncate ( string $table, boolean $cascade = false )
$table string Table name
$cascade boolean

update() public method

Update
public update ( string $table, array $data, array $where )
$table string Table name
$data array Array of data for WHERE clause in 'field' => 'value' format
$where array

Property Details

$_noQuote protected_oe property

protected $_noQuote

$mapper protected_oe property

protected Mapper,Spot $mapper
return Spot\Mapper