| Current Path : /var/www/v3.cesa.co.za/src/ContentBundle/DataFixtures/ORM/ |
| Current File : /var/www/v3.cesa.co.za/src/ContentBundle/DataFixtures/ORM/LoadFormTypeData.php |
<?php
namespace App\ContentBundle\DataFixtures\ORM;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Bundle\FixturesBundle\ORMFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Load default content types
*
* @author Otto Saayman <otto@igotafrica.com>
* @version 1.0
* @package ContentBundle
* @subpackage DataFixtures
* @version 0.0.1
*/
class LoadFormTypeData extends Fixture implements ORMFixtureInterface, OrderedFixtureInterface, ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
private $container;
/**
* {@inheritDoc}
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
public function load(ObjectManager $manager): void
{
$formTypeManager = $this->container->get('form_type.manager');
$formType = $formTypeManager->checkAndLoad('BCE Trimester Evaluation');
$this->addReference('enquiry-form-type', $formType);
}
public function getOrder(): int
{
return 460; // the order in which fixtures will be loaded
}
}