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.
- Host: GitHub
- URL: https://github.com/boldare/xsolve-model-factory-bundle
- Owner: boldare
- License: mit
- Created: 2016-08-17T20:01:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T15:48:50.000Z (over 3 years ago)
- Last Synced: 2025-04-23T00:06:10.937Z (about 1 year ago)
- Language: PHP
- Size: 54.7 KB
- Stars: 13
- Watchers: 58
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/xsolve-pl/xsolve-model-factory-bundle)
[](https://scrutinizer-ci.com/g/xsolve-pl/xsolve-model-factory-bundle/?branch=master)
[](https://packagist.org/packages/xsolve-pl/model-factory-bundle)
[](https://packagist.org/packages/xsolve-pl/model-factory-bundle)
[](https://packagist.org/packages/xsolve-pl/model-factory-bundle)
[](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.