Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oligus/doctrine-fixtures
Doctrine fixtures
https://github.com/oligus/doctrine-fixtures
database doctrine fixture-data mock-data
Last synced: about 1 month ago
JSON representation
Doctrine fixtures
- Host: GitHub
- URL: https://github.com/oligus/doctrine-fixtures
- Owner: oligus
- License: mit
- Created: 2019-09-06T19:07:18.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-14T22:22:40.000Z (almost 5 years ago)
- Last Synced: 2024-09-23T17:39:26.512Z (about 2 months ago)
- Topics: database, doctrine, fixture-data, mock-data
- Language: PHP
- Size: 108 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Doctrine fixtures
Simple fixture loader for Doctrine.
[![Build Status](https://travis-ci.org/oligus/doctrine-fixtures.svg?branch=master)](https://travis-ci.org/oligus/doctrine-fixtures)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Codecov.io](https://codecov.io/gh/oligus/doctrine-fixtures/branch/master/graphs/badge.svg)](https://codecov.io/gh/oligus/doctrine-fixtures)
[![Maintainability](https://codeclimate.com/github/codeclimate/codeclimate/badges/gpa.svg)](https://codeclimate.com/github/oligus/doctrine-fixtures/maintainability)Load XML fixtures into database using entity manager.
## Quick start
```bash
$ composer require oligus/doctrine-fixtures --dev
```*Load all fixtures in a directory*
```php
$fixture = new FixtureManager($em, new XmlLoader('path/to/fixtures'));
$fixture->loadAll();
```*Load a single fixture file*
```php
$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
```bash
$ mysqldump -h localhost -u username --password=password --xml -t database data_table --where="id='1'"
```