PHP Class Phactory\Sql\Blueprint

Afficher le fichier Open project: chriskite/phactory

Protected Properties

Свойство Type Description
$_associations
$_defaults
$_phactory
$_sequence
$_table

Méthodes publiques

Méthode 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 )

Méthodes protégées

Méthode Description
_associateManyToMany ( $row, $many_to_many )
_evalSequence ( &$data )

Method Details

__construct() public méthode

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

_associateManyToMany() protected méthode

protected _associateManyToMany ( $row, $many_to_many )

_evalSequence() protected méthode

protected _evalSequence ( &$data )

addAssociation() public méthode

public addAssociation ( $name, $association )

addDefault() public méthode

public addDefault ( $column, $value )

build() public méthode

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 méthode

* 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 méthode

* Truncate table in the database.
public recall ( )

removeAssociation() public méthode

public removeAssociation ( $name )

removeDefault() public méthode

public removeDefault ( $column )

setAssociations() public méthode

public setAssociations ( $associations )

setDefaults() public méthode

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