<?php
/**
 * Created by PhpStorm.
 * User: vlade
 * Date: 9/15/14
 * Time: 2:13 PM
 */

namespace VGM\WOBundle\DataFixtures\ORM;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use VGM\WOBundle\Entity\NDepartment;


class loadDepartmentData extends AbstractFixture implements OrderedFixtureInterface
{
    public function load(ObjectManager $em)
    {
        /*$d1 = new NDepartment();
        $d1->setName('Electric');
        $d1->setDescription('Description 1');

        $d2 = new NDepartment();
        $d2->setName('Paint');
        $d2->setDescription('Description 2');

        $d3 = new NDepartment();
        $d3->setName('Cleaning');
        $d3->setDescription('Description 3');

        $d4 = new NDepartment();
        $d4->setName('Tires');
        $d4->setDescription('Description 4');

        $d5 = new NDepartment();
        $d5->setName('Hydraulic');
        $d5->setDescription('Description 5');

        $em->persist($d1);
        $em->persist($d2);
        $em->persist($d3);
        $em->persist($d4);
        $em->persist($d5);

        $em->flush();*/
    }

    public function getOrder()
    {
        return 5; // the order in which fixtures will be loaded
    }
}