class FixtureBlueprint

A blueprint on how to create instances of a certain {@link DataObject} subclass.

Relies on a {@link FixtureFactory} to manage database relationships between instances, and manage the mappings between fixture identifiers and their database IDs.

Config options

dependencies

Methods

__construct(String $name, String $class = null, array $defaults = array())

No description

createObject(string $identifier, array $data = null, array $fixtures = null)

No description

$this
setDefaults(array $defaults)

No description

array
getDefaults()

No description

string
getClass()

No description

$this
addCallback(string $type, callable $callback)

See class documentation.

$this
removeCallback(string $type, callable $callback)

No description

Details

at line 55
__construct(String $name, String $class = null, array $defaults = array())

Parameters

String $name
String $class Defaults to $name
array $defaults

at line 83
DataObject createObject(string $identifier, array $data = null, array $fixtures = null)

Parameters

string $identifier Unique identifier for this fixture type
array $data Map of property names to their values.
array $fixtures Map of fixture names to an associative array of their in-memory identifiers mapped to their database IDs. Used to look up existing fixtures which might be referenced in the $data attribute via the => notation.

Return Value

DataObject

Exceptions

Exception

at line 254
$this setDefaults(array $defaults)

Parameters

array $defaults

Return Value

$this

at line 263
array getDefaults()

Return Value

array

at line 271
string getClass()

Return Value

string

at line 283
$this addCallback(string $type, callable $callback)

See class documentation.

Parameters

string $type
callable $callback

Return Value

$this

at line 298
$this removeCallback(string $type, callable $callback)

Parameters

string $type
callable $callback

Return Value

$this