class Populator

Service class for populating a database using the Doctrine ORM or ODM.

A Populator can populate several tables using ActiveRecord classes.

Methods

__construct( Generator $generator, ObjectManager $manager = null)

No description

addEntity($entity, $number, $customColumnFormatters = array(), $customModifiers = array(), $generateId = false)

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

array
execute( null|EntityManager $entityManager = null)

Populate the database using all the Entity classes previously added.

Details

__construct( Generator $generator, ObjectManager $manager = null)

Parameters

Generator $generator
ObjectManager $manager

addEntity($entity, $number, $customColumnFormatters = array(), $customModifiers = array(), $generateId = false)

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

Parameters

$entity
$number
$customColumnFormatters
$customModifiers
$generateId

array execute( null|EntityManager $entityManager = null)

Populate the database using all the Entity classes previously added.

Parameters

null|EntityManager $entityManager A Doctrine connection object

Return Value

array A list of the inserted PKs