class Populator

Service class for populating a database using the Spot ORM.

Methods

__construct( Generator $generator, Locator $locator = null)

Populator constructor.

addEntity($entityName, $number, $customColumnFormatters = array(), $customModifiers = array(), $useExistingData = false)

Add an order for the generation of $number records for $entity.

array
execute( Locator $locator = null)

Populate the database using all the Entity classes previously added.

Details

__construct( Generator $generator, Locator $locator = null)

Populator constructor.

Parameters

Generator $generator
Locator $locator

addEntity($entityName, $number, $customColumnFormatters = array(), $customModifiers = array(), $useExistingData = false)

Add an order for the generation of $number records for $entity.

Parameters

$entityName string Name of Entity object to generate
$number int The number of entities to populate
$customColumnFormatters array
$customModifiers array
$useExistingData bool Should we use existing rows (e.g. roles) to populate relations?

array execute( Locator $locator = null)

Populate the database using all the Entity classes previously added.

Parameters

Locator $locator A Spot locator

Return Value

array A list of the inserted PKs