PHP Class Phactory\Sql\Blueprint

Exibir arquivo Open project: chriskite/phactory

Protected Properties

Property Type Description
$_associations
$_defaults
$_phactory
$_sequence
$_table

Public Methods

Method Description
__construct ( $name, $defaults, $associations = [], Phactory $phactory = null )
addAssociation ( $name, $association )
addDefault ( $column, $value )
build ( $overrides = [], $associated = [] ) * Build a Row from this Blueprint. Optionally use an array of associated objects to set fk columns.
create ( $overrides = [], $associated = [] ) * Reify a Blueprint as a Row. Optionally use an array of associated objects to set fk columns.
recall ( ) * Truncate table in the database.
removeAssociation ( $name )
removeDefault ( $column )
setAssociations ( $associations )
setDefaults ( $defaults )

Protected Methods

Method Description
_associateManyToMany ( $row, $many_to_many )
_evalSequence ( &$data )

Method Details

__construct() public method

public __construct ( $name, $defaults, $associations = [], Phactory $phactory = null )
$phactory Phactory

_associateManyToMany() protected method

protected _associateManyToMany ( $row, $many_to_many )

_evalSequence() protected method

protected _evalSequence ( &$data )

addAssociation() public method

public addAssociation ( $name, $association )

addDefault() public method

public addDefault ( $column, $value )

build() public method

Note that this function ignores ManyToMany associations, as those can't be handled unless the Row is actually saved to the db.
public build ( $overrides = [], $associated = [] )
$associated [table name] => [Row]

create() public method

* Reify a Blueprint as a Row. Optionally use an array of associated objects to set fk columns.
public create ( $overrides = [], $associated = [] )
$associated [table name] => [Row]

recall() public method

* Truncate table in the database.
public recall ( )

removeAssociation() public method

public removeAssociation ( $name )

removeDefault() public method

public removeDefault ( $column )

setAssociations() public method

public setAssociations ( $associations )

setDefaults() public method

public setDefaults ( $defaults )

Property Details

$_associations protected_oe property

protected $_associations

$_defaults protected_oe property

protected $_defaults

$_phactory protected_oe property

protected $_phactory

$_sequence protected_oe property

protected $_sequence

$_table protected_oe property

protected $_table