vendor/bundles/Symfony/Bundle/DoctrineFixturesBundle/Common/DataFixtures/Loader.php
author cavaliet
Thu, 23 Feb 2012 18:52:59 +0100
changeset 73 c8ecf6c0bdd3
parent 58 624e5900f5a4
permissions -rw-r--r--
Add configuration to enable curl request with proxy or any other CURLOPT

<?php

namespace Symfony\Bundle\DoctrineFixturesBundle\Common\DataFixtures;

use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\DataFixtures\Loader as BaseLoader;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class Loader extends BaseLoader
{
    private $container;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function addFixture(FixtureInterface $fixture)
    {
        if ($fixture instanceof ContainerAwareInterface) {
            $fixture->setContainer($this->container);
        }

        parent::addFixture($fixture);
    }
}