PHP code example of dkorsak / doctrine-data-fixture-module
1. Go to this page and download the library: Download dkorsak/doctrine-data-fixture-module library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dkorsak / doctrine-data-fixture-module example snippets
return array(
'doctrine' => array(
'fixture' => array(
'ModuleName' => __DIR__ . '/../src/ModuleName/Fixture',
)
)
);
namespace Application\DataFixtures;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use DoctrineDataFixtureModule\ContainerAwareInterface;
use DoctrineDataFixtureModule\ContainerAwareTrait;
class LoadUser implements FixtureInterface, ContainerAwareInterface
{
use ContainerAwareTrait;
/**
* @param ObjectManager $manager
*/
public function load(ObjectManager $manager)
{
$myService = $this->container->get('my_service');
}
}