oligus/doctrine-fixtures

Doctrine fixtures

0.1.5 2019-12-14 22:21 UTC

This package is auto-updated.

Last update: 2024-10-15 09:07:45 UTC


README

Simple fixture loader for Doctrine.

Build Status License: MIT Codecov.io Maintainability

Load XML fixtures into database using entity manager.

Quick start

$ composer require oligus/doctrine-fixtures --dev

Load all fixtures in a directory

$fixture = new FixtureManager($em, new XmlLoader('path/to/fixtures'));
$fixture->loadAll();

Load a single fixture file

$fixture = new FixtureManager($em, new XmlLoader());
$fixture->loadFile('path/to/fixtures/data_table.xml');

Availible Loaders

  • Xml Loader
  • Csv Loader

Fixtures

Creating XML fixture from mysql database

$ mysqldump -h localhost -u username --password=password --xml -t database data_table --where="id='1'"