An open API service indexing awesome lists of open source software.

https://github.com/boldare/xsolve-model-factory-bundle

This bundle provides a versatile skeleton for organizing model factories.
https://github.com/boldare/xsolve-model-factory-bundle

Last synced: 9 months ago
JSON representation

This bundle provides a versatile skeleton for organizing model factories.

Awesome Lists containing this project

README

          

[![Build Status](https://travis-ci.org/xsolve-pl/xsolve-model-factory-bundle.svg?branch=master)](https://travis-ci.org/xsolve-pl/xsolve-model-factory-bundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/xsolve-pl/xsolve-model-factory-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/xsolve-pl/xsolve-model-factory-bundle/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/xsolve-pl/model-factory-bundle/v/stable)](https://packagist.org/packages/xsolve-pl/model-factory-bundle)
[![Total Downloads](https://poser.pugx.org/xsolve-pl/model-factory-bundle/downloads)](https://packagist.org/packages/xsolve-pl/model-factory-bundle)
[![Monthly Downloads](https://poser.pugx.org/xsolve-pl/model-factory-bundle/d/monthly)](https://packagist.org/packages/xsolve-pl/model-factory-bundle)
[![License](https://poser.pugx.org/xsolve-pl/model-factory-bundle/license)](https://packagist.org/packages/xsolve-pl/model-factory-bundle)

Table of contents
=================

* [Introduction](#introduction)
* [License](#license)
* [Getting started](#getting-started)
* [Usage examples](#usage-examples)
* [Grouping model factories into collections](#grouping-model-factories-into-collections)

Introduction
============

This bundle wraps [xsolve-pl/model-factory](https://packagist.org/packages/xsolve-pl/model-factory)
library and allows to compose collections of model factories declared as services
with the use of tags.

See the library documentation for more details on specific use cases.

License
=======

This bundle is under the MIT license. See the complete license in `LICENSE` file.

Getting started
===============

Include this bundle in your Symfony project using Composer as follows
(assuming it is installed globally):

```bash
$ composer require xsolve-pl/model-factory-bundle
```

For more information on Composer see its
[Introduction](https://getcomposer.org/doc/00-intro.md).

Afterwards you need to enable this bundle by adding a line to `app/AppKernel.php`
file of your project:

```php




```

This snippet defines two model factory collections (with ids
`example.model_factory_collection.first` and
`example.model_factory_collection.second` respectively). It also defines a
single model factory (with id `example.model_factory.foo`). This service has a
tag assigned with `name` attribute equal
`xsolve.model_factory_bundle.model_factory` (which will result in it being
processed by
`Xsolve\ModelFactoryBundle\DependencyInjection\CompilerPass\ModelFactoryCollectionCompilerPass`)
and `model-factory-collection-id` attribute containing service ids of
respective collections.