PHPackages                             creakiwi/yaml-fixtures - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. creakiwi/yaml-fixtures

ActiveLibrary

creakiwi/yaml-fixtures
======================

Symfony YamlFixtures on top of DoctrineFixturesBundle

v0.1.1.1(11y ago)040MITPHP

Since Oct 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/creakiwi/YamlFixtures)[ Packagist](https://packagist.org/packages/creakiwi/yaml-fixtures)[ Docs](https://github.com/creakiwi/YamlFixtures)[ RSS](/packages/creakiwi-yaml-fixtures/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

YamlFixtures
============

[](#yamlfixtures)

Overview
--------

[](#overview)

A simple abstraction class to use yaml fixtures, instead of PHP classes, on top of DoctrineFixturesBundle. It also allows the use of particular keywords such as %self% (the reference key of the yaml definition, in case of key =&gt; mixed value declaration) or %field% (where "field" refers to a previously defined field). Finally, this bundle handle One-to-One, Many-to-One and Many-to-Many relations, with the @ prefix.

Warning
-------

[](#warning)

The bundle isn't currently unit tested, use it at your own risks! You might need it to bootstrap your database, but never use it once you are in production mode (this rules is also true for DoctrineFixturesBundle in my opinion).

Examples
--------

[](#examples)

### 1. Keywords usage example

[](#1-keywords-usage-example)

Let's say you have a unique entity User composed of the following fields :

- id : autogenerated it won't be used here
- username
- email

First of all, you have to extends the YamlFixtures class :

```
// src/Acme/DemoBundle/DataFixtures/ORM
