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

setDefaults(Array $defaults)

No description

Array
getDefaults()

No description

String
getClass()

No description

addCallback(String $type, callable $callback)

See class documentation.

removeCallback(String $type, callable $callback)

No description

Details

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

Parameters

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

at line 70
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

at line 234
setDefaults(Array $defaults)

Parameters

Array $defaults

at line 242
Array getDefaults()

Return Value

Array

at line 249
String getClass()

Return Value

String

at line 259
addCallback(String $type, callable $callback)

See class documentation.

Parameters

String $type
callable $callback

at line 272
removeCallback(String $type, callable $callback)

Parameters

String $type
callable $callback