Documentation

Populator
in package

Service class for populating a database using Mandango.

A Populator can populate several tables using ActiveRecord classes.

Table of Contents

$entities  : mixed
$generator  : mixed
$mandango  : mixed
$quantities  : mixed
__construct()  : mixed
addEntity()  : mixed
Add an order for the generation of $number records for $entity.
execute()  : array<string|int, mixed>
Populate the database using all the Entity classes previously added.

Properties

$quantities

protected mixed $quantities = []

Methods

__construct()

public __construct(Generator $generator, Mandango $mandango) : mixed
Parameters
$generator : Generator
$mandango : Mandango
Return values
mixed

addEntity()

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

public addEntity(mixed $entity, int $number[, mixed $customColumnFormatters = [] ]) : mixed
Parameters
$entity : mixed

A Propel ActiveRecord classname, or a \Faker\ORM\Propel\EntityPopulator instance

$number : int

The number of entities to populate

$customColumnFormatters : mixed = []
Return values
mixed

execute()

Populate the database using all the Entity classes previously added.

public execute() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of the inserted entities.

Search results