mehlah/li3_populator

Populate a database with mass insertion

Maintainers

Package info

github.com/mehlah/li3_populator

Type:lithium-library

pkg:composer/mehlah/li3_populator

Statistics

Installs: 220

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 0

dev-master 2013-09-15 17:06 UTC

This package is not auto-updated.

Last update: 2026-03-14 20:56:51 UTC


README

li3_populator library let you generate fake data for your Lithium models and save them in the database. It provides a Lithium's ORM/ODM adapter to Faker.

Usage Example

Here is an example showing how to populate 50 People data objects (instances of lithium\data\entity\Record or lithium\data\entity\Document), and save the records or documents in the database.

use faker\Factory;
use li3_populator\extensions\adapter\ORM\Lithium\Populator;

$generator = Factory::create();
$populator = new Populator($generator);
$populator->addEntity('People', 50);
$people_ids = $populator->execute();

The populator will guess the relevant data for each field based on your models schema definitions.

For a more advanced usage, take a look to Faker docs.

Installation

This library is installable via Composer as mehlah/li3_populator.

Don't forget to add the library to your application in config/bootstrap/libraries.php

Libraries::add('li3_populator');