class FixtureBlueprint (View source)

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.

Properties

static private $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

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

Parameters

string $name
string $class

Defaults to $name

array $defaults

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

setDefaults(array $defaults)

Parameters

array $defaults

array getDefaults()

Return Value

array

string getClass()

Return Value

string

addCallback(string $type, callable $callback)

See class documentation.

Parameters

string $type
callable $callback

removeCallback(string $type, callable $callback)

Parameters

string $type
callable $callback