/**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     /**
      * @var EntityManager $em
      */
     $em = $this->container->get('doctrine')->getManager();
     $bundle = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'accounting']);
     if (!$bundle) {
         $bundle = new Bundle();
         $bundle->setName('accounting');
         $em->persist($bundle);
         $em->flush();
     }
     //        $parent = $em->getRepository('CoreBundle:Menu')->findOneBy(['title' => 'Sportmaster']);
     $type = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $type2 = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'header']);
     $bundleCore = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'core']);
     $item1 = new Menu();
     $item1->setMenuTypeId($type)->setBundleId($bundle)->setTitle('Esab Act')->setUrl('accounting_export_esab')->setCss('fa fa-list')->setStatus(1)->setWeight(0);
     $item4 = new Menu();
     $item4->setMenuTypeId($type2)->setBundleId($bundleCore)->setTitle('Accounting')->setUrl('accounting_homepage')->setCss('fa')->setStatus(1)->setParent(40)->setWeight(5);
     $em->persist($item1);
     $em->persist($item4);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => self::ROLE_USER]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item4->getId(), 'role_id' => self::ROLE_USER]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $em = $this->container->get('doctrine')->getManager();
     $typeSidebar = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $bundleCore = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'core']);
     $item1 = new Menu();
     $item1->setMenuTypeId($typeSidebar)->setBundleId($bundleCore)->setTitle('Settings')->setUrl('core_homepage')->setCss('fa fa-cog')->setStatus(1)->setWeight(10);
     $em->persist($item1);
     $em->flush();
     $item2 = new Menu();
     $item2->setMenuTypeId($typeSidebar)->setBundleId($bundleCore)->setTitle('ContainerGroup')->setUrl('container_group')->setCss('fa fa-circle')->setStatus(1)->setWeight(2)->setParent($item1->getId());
     $item3 = new Menu();
     $item3->setMenuTypeId($typeSidebar)->setBundleId($bundleCore)->setTitle('ContainerType')->setUrl('container_type')->setCss('fa fa-circle')->setStatus(1)->setWeight(2)->setParent($item1->getId());
     $item4 = new Menu();
     $item4->setMenuTypeId($typeSidebar)->setBundleId($bundleCore)->setTitle('Vehicle')->setUrl('vehicle')->setCss('fa fa-circle')->setStatus(1)->setWeight(3)->setParent($item1->getId());
     $item5 = new Menu();
     $item5->setMenuTypeId($typeSidebar)->setBundleId($bundleCore)->setTitle('Events')->setUrl('event')->setCss('fa fa-circle')->setStatus(1)->setWeight(4)->setParent($item1->getId());
     $em->persist($item2);
     $em->persist($item3);
     $em->persist($item4);
     $em->persist($item5);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item2->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item3->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item4->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item5->getId(), 'role_id' => self::ROLE_ADMIN]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     /**
      * @var EntityManager $em
      */
     $em = $this->container->get('doctrine')->getManager();
     //        $parent = $em->getRepository('CoreBundle:Menu')->findOneBy(['title' => 'Sportmaster']);
     $type = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $type2 = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'header']);
     $bundle = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'sportmaster']);
     $bundleCore = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'core']);
     $item1 = new Menu();
     $item1->setMenuTypeId($type)->setBundleId($bundle)->setTitle('Import Reference Table')->setUrl('sportmaster_import_reference')->setCss('fa fa-list')->setStatus(1)->setWeight(0);
     $item2 = new Menu();
     $item2->setMenuTypeId($type)->setBundleId($bundle)->setTitle('Import SCA Log')->setUrl('sportmaster_import_spm_interface_log')->setCss('fa fa-list')->setStatus(1)->setWeight(1);
     $item3 = new Menu();
     $item3->setMenuTypeId($type)->setBundleId($bundle)->setTitle('SCA log list')->setUrl('sportmaster_import_sca_log_list')->setCss('fa fa-list')->setStatus(1)->setWeight(2);
     $item4 = new Menu();
     $item4->setMenuTypeId($type2)->setBundleId($bundleCore)->setTitle('Sportmaster')->setUrl('sportmaster_homepage')->setCss('fa fa-plane')->setStatus(1)->setParent(40)->setWeight(2);
     $em->persist($item1);
     $em->persist($item2);
     $em->persist($item3);
     $em->persist($item4);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item2->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item3->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item4->getId(), 'role_id' => self::ROLE_ADMIN]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     $em = $this->container->get('doctrine')->getManager();
     $typeSidebar = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $bundleCore = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'core']);
     $item1 = $em->getRepository('CoreBundle:Menu')->findOneBy(['url' => 'core_homepage', 'title' => 'Settings']);
     $item3 = new Menu();
     $item3->setMenuTypeId($typeSidebar)->setBundleId($bundleCore)->setTitle('DocumentType')->setUrl('document_type')->setCss('fa fa-circle')->setStatus(1)->setWeight(5)->setParent($item1->getId());
     $em->persist($item3);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item3->getId(), 'role_id' => self::ROLE_ADMIN]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     // this up() migration is auto-generated, please modify it to your needs
     $em = $this->container->get('doctrine')->getManager();
     $bundle = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'sportmaster']);
     $type = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $item1 = new Menu();
     $item1->setMenuTypeId($type)->setBundleId($bundle)->setTitle('Import booking')->setUrl('sportmaster_import_booking')->setCss('fa fa-list')->setStatus(1)->setWeight(4);
     $em->persist($item1);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => self::ROLE_USER]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     /**
      * @var EntityManager $em
      */
     $em = $this->container->get('doctrine')->getManager();
     $type2 = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'header']);
     $bundleCore = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'core']);
     $item4 = new Menu();
     $item4->setMenuTypeId($type2)->setBundleId($bundleCore)->setTitle('Documents')->setUrl('document')->setCss('fa fa-list-alt')->setStatus(1)->setParent(40)->setWeight(10);
     $em->persist($item4);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item4->getId(), 'role_id' => self::ROLE_ADMIN]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     /**
      * @var EntityManager $em
      */
     $em = $this->container->get('doctrine')->getManager();
     $role = new Role();
     $role->setRole('ROLE_SPORTMASTER_USER')->setDescription('Sportmaster user');
     $em->persist($role);
     //        $parent = $em->getRepository('CoreBundle:Menu')->findOneBy(['title' => 'Sportmaster']);
     $type = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $bundle = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'sportmaster']);
     $item1 = new Menu();
     $item1->setMenuTypeId($type)->setBundleId($bundle)->setTitle('Invoicing wizard')->setUrl('sportmaster_invoice_number')->setCss('fa fa-list')->setStatus(1)->setWeight(5);
     $em->persist($item1);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => self::ROLE_ADMIN]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => $role->getId()]);
 }
 /**
  * @param Schema $schema
  */
 public function up(Schema $schema)
 {
     /**
      * @var EntityManager $em
      */
     $em = $this->container->get('doctrine')->getManager();
     $bundle = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'customs']);
     $type = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'sidebar']);
     $type2 = $em->getRepository('CoreBundle:MenuType')->findOneBy(['name' => 'header']);
     $bundleCore = $em->getRepository('CoreBundle:Bundle')->findOneBy(['name' => 'core']);
     $item1 = new Menu();
     $item1->setMenuTypeId($type)->setBundleId($bundle)->setTitle('Certificates')->setUrl('lpp_sertificates')->setCss('fa fa-list')->setStatus(1)->setWeight(0);
     $item4 = new Menu();
     $item4->setMenuTypeId($type2)->setBundleId($bundleCore)->setTitle('Customs Clearance')->setUrl('customs_homepage')->setCss('fa fa-check-square-o')->setStatus(1)->setParent(40)->setWeight(11);
     $em->persist($item1);
     $em->persist($item4);
     $em->flush();
     $em->getConnection()->insert('menu_role', ['menu_id' => $item4->getId(), 'role_id' => self::ROLE_USER]);
     $em->getConnection()->insert('menu_role', ['menu_id' => $item1->getId(), 'role_id' => self::ROLE_USER]);
 }