nelmio/alice — pull request #46 by erichard (2013-07-10 20:18:06+00:00)
Title: [WIP] Inheritance system

# Inheritance system

This PR add an inheritance system to the yaml fixtures syntax. It is a **Work In Progress** feature.

## Why

As I described in a [comment](https://github.com/nelmio/alice/pull/21#issuecomment-18900621) in another PR, I often have to copy paste instance block to supercharge some properties. I feel so wrong that I wrote this PR to avoid this :-)

## How

Basically, you have two concepts: *pure templates* and *instances*. The first one does not need to be persisted and the second need to be persisted. We just need a syntax to identify them.

### Pure templates

I use a simple `_name_` syntax to define a *pure template*. Theses templates can extends another templates.

### Instances

Instances still use the original alice syntax, the only addition is that you can extends a template with the `@` operator. The only constraint you have is to define template **before** use it.

## Advanced uses

All instances block are registered to be template, only the *pure* one will not be persisted.

## Full example

```
User:
_base_:
username:
email:
is_admin: 0

admin@base:
is_admin: 1

anotheradmin@admin:
email:
```