2017 © Pedro Peláez
 

lithium-library li3_populator

Populate a database with mass insertion

image

mehlah/li3_populator

Populate a database with mass insertion

  • Sunday, September 15, 2013
  • by mehlah
  • Repository
  • 2 Watchers
  • 3 Stars
  • 214 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Lithium Populator

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., (*1)

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., (*2)

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., (*3)

For a more advanced usage, take a look to Faker docs., (*4)

Installation

This library is installable via Composer as mehlah/li3_populator., (*5)

Don't forget to add the library to your application in config/bootstrap/libraries.php, (*6)

Libraries::add('li3_populator');

The Versions

15/09 2013

dev-master

9999999-dev

Populate a database with mass insertion

  Sources   Download

MIT

The Requires

 

by Mehdi Lahmam B.

fixtures faker