oligus / doctrine-fixtures
Doctrine fixtures
Installs: 3 626
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=7.3
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
Requires (Dev)
- ext-json: *
- doctrine/orm: ^2.6
- phan/phan: ^2.4
- phpmd/phpmd: ^2.7
- phpunit/phpunit: ^8.3
- spatie/phpunit-snapshot-assertions: ^2.1
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^4.3
README
Simple fixture loader for Doctrine.
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'"