Skip to content

Commit

Permalink
Added documentation for ProvidesFixtureInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
djlambert committed Sep 18, 2012
1 parent 946beff commit cf51dbb
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Expand Up @@ -160,6 +160,37 @@ Provide an array of fixture class names:
{}
}

or define alias names with ProvidesFixtureInterface:

namespace MyDataFixtures;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\DataFixtures\ProvidesFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;

class MyFixture extends AbstractFixture implements DependentFixtureInterface
{
public function load(ObjectManager $manager)
{}

public function getDepends()
{
return array('Other'); // fixture class(es) or provides string(s) fixture is dependent on
}
}

class MyOtherFixture extends AbstractFixture implements ProvidesFixtureInterface
{
public function load(ObjectManager $manager)
{}

public function getProvides()
{
return 'Other';
}
}

**Notice** the ordering is relevant to Loader class.

## Running the tests:
Expand Down

0 comments on commit cf51dbb

Please sign in to comment.