PHPackages                             webgriffe/doctrine-fixtures-loader - 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. webgriffe/doctrine-fixtures-loader

AbandonedArchivedLibrary

webgriffe/doctrine-fixtures-loader
==================================

Base loader for your project's object fixtures, with all their dependencies, using Doctrine and closures.

01.1kPHP

Since Nov 28Pushed 12y ago8 watchersCompare

[ Source](https://github.com/webgriffe/doctrine-fixtures-loader)[ Packagist](https://packagist.org/packages/webgriffe/doctrine-fixtures-loader)[ RSS](/packages/webgriffe-doctrine-fixtures-loader/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Doctrine Fixtures Loader
========================

[](#doctrine-fixtures-loader)

Base loader for your project's object fixtures, with all their dependencies, using Doctrine and closures.

Introduction
------------

[](#introduction)

Typically in a real project that uses Doctrine, you have tons of entities related with each others that needs to be loaded during functional tests using `doctrine/data-fixtures` library. This base loader helps you to mantain a fixtures loader for your project that can give to the caller an instance of an object with all related dependencies loaded. See the example below.

Usage
-----

[](#usage)

Suppose that your project has the following entities:

- Order
- Product
- Customer

Suppose that for every Order you have many Products and one Customer. Suppose that you need a fixture that loads an Order with a specific payment method. Suppose that your application requires that an Order must have all dependencies set. In this case, what you have to do is to instantiate an Order, **with all of its dependencies**, like as follows:

```
