Spork Code Libraries

Constants

PATTERN_TABLE

PATTERN_TABLE

PATTERN_CREATE_TABLE

PATTERN_CREATE_TABLE

PATTERN_ADD_COLUMN

PATTERN_ADD_COLUMN

Properties

$db

$db : \Zend\Db\Adapter\Adapter

Type

\Zend\Db\Adapter\Adapter — | string
Inherited from
\SporkTools\Core\Job\Plugin\DbAdapter

Methods

__construct()

__construct(array  $options = array()) 

Parameters

array $options
Inherited from
\SporkTools\Core\Job\Plugin\DbAdapter

attach()

attach(\Zend\EventManager\EventManagerInterface  $events) 

Parameters

\Zend\EventManager\EventManagerInterface $events
Inherited from
\SporkTools\Core\Job\Plugin\AbstractPlugin

getDb()

getDb() 

Inherited from
\SporkTools\Core\Job\Plugin\DbAdapter

getMethods()

getMethods() 

initialize()

initialize(\SporkTools\Core\Job\Event  $event) 

Injects message plugin and database adapter when job is run

Parameters

\SporkTools\Core\Job\Event $event

setDb()

setDb(  $db) 

Parameters

$db
Inherited from
\SporkTools\Core\Job\Plugin\DbAdapter
Inherited from
\SporkTools\Core\Job\Plugin\AbstractPlugin

addColumn()

addColumn(string  $sql) 

Adds a column to a table.

Attempts to check if the column already exists and if it does skips the update;

Parameters

string $sql

SQL add column statement

addTable()

addTable(  $sql) 

Parameters

$sql

dropTable()

dropTable(  $table,   $schema = null) 

Parameters

$table
$schema

dropColumn()

dropColumn(  $column,   $table,   $schema = null) 

Parameters

$column
$table
$schema

hasColumn()

hasColumn(string  $column, string  $table, string  $schema = null) : boolean

Test if a table column exists

Parameters

string $column
string $table
string $schema

Returns

boolean

hasTable()

hasTable(  $table,   $schema = null) 

Parameters

$table
$schema

isColumnType()

isColumnType(  $type,   $column,   $table,   $schema = null) 

Parameters

$type
$column
$table
$schema

query()

query(  $sql,   $parameters = null) 

Parameters

$sql
$parameters

normalizeSchema()

normalizeSchema(  $schema) 

Parameters

$schema