Skip to content

Commit

Permalink
More doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Dec 5, 2015
1 parent 2cbe84d commit a580191
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ public function registerBundles()

namespace Acme\Bundle\SomeBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Ticketpark\FixturesAutoloadBundle\Autoloader\Autoloader;

class LoadCountryData extends AutoLoader
class LoadCountryData extends AutoLoader implements FixtureInterface
{
public function load(ObjectManager $manager)
{
Expand Down Expand Up @@ -77,11 +78,12 @@ In a second fixture class, references will be available based on the entity name

namespace Acme\Bundle\SomeBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Ticketpark\FixturesAutoloadBundle\Autoloader\Autoloader;

class LoadUserData extends AutoLoader implements DependentFixtureInterface
class LoadUserData extends AutoLoader implements FixtureInterface, DependentFixtureInterface
{
public function getDependencies()
{
Expand Down Expand Up @@ -116,10 +118,11 @@ In some cases you might want to override the setter methods. for instance becaus

namespace Acme\Bundle\SomeBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Ticketpark\FixturesAutoloadBundle\Autoloader\Autoloader;

class LoadCurrencyData extends AutoLoader
class LoadCurrencyData extends AutoLoader implements FixtureInterface
{
public function load(ObjectManager $manager)
{
Expand Down Expand Up @@ -148,10 +151,11 @@ Another option to treat an array like a single element and inject the full array

namespace Acme\Bundle\SomeBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Ticketpark\FixturesAutoloadBundle\Autoloader\Autoloader;

class LoadCurrencyData extends AutoLoader
class LoadCurrencyData extends AutoLoader implements FixtureInterface
{
public function load(ObjectManager $manager)
{
Expand All @@ -163,8 +167,7 @@ class LoadCurrencyData extends AutoLoader
),
);

// this will cause a call to setCurrencies() with
// the full currencies array
// this will cause a call to setCurrencies() with the full currencies array
$treatAsSingles = array('currencies');
$this->autoload($data, $manager, array(), $treatAsSingles);
}
Expand Down

0 comments on commit a580191

Please sign in to comment.