vendor/globunet/notification-bundle/GlobunetNotificationBundle.php line 18

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Globunet Project package.
  4.  *
  5.  * Created by Globunet on 10/04/16. <info@globunet.com>
  6.  * Copyright (c) 2015 Globunet Soluciones Tecnológicas, SL. All rights reserved.
  7.  *
  8.  */
  9. namespace Globunet\NotificationBundle;
  10. use Symfony\Component\HttpKernel\Bundle\Bundle;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. use Doctrine\DBAL\Types\Type;
  13. use Globunet\NotificationBundle\DependencyInjection\Compiler\AddHandlerPass;
  14. class GlobunetNotificationBundle extends Bundle
  15. {
  16.     public function build(ContainerBuilder $container)
  17.     {
  18.         $container->addCompilerPass(new AddHandlerPass());
  19.     }
  20.     public function boot(){
  21.         $em $this->container->get('doctrine.orm.entity_manager');
  22.         // Comprobar si ya se definieron los tipos
  23.         if (!Type::hasType("NOTIFICATION_TYPE")) {
  24.             Type::addType('NOTIFICATION_TYPE''Globunet\NotificationBundle\Entity\DBAL\EnumNotificationType');
  25.             $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('NOTIFICATION_TYPE','NOTIFICATION_TYPE');
  26.         }
  27.         
  28.         if (!Type::hasType("NOTIFICATION_ACTION_TYPE")) {
  29.             Type::addType('NOTIFICATION_ACTION_TYPE''Globunet\NotificationBundle\Entity\DBAL\EnumNotificationActionType');
  30.             $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('NOTIFICATION_ACTION_TYPE','NOTIFICATION_ACTION_TYPE');
  31.         }
  32.         
  33.         if (!Type::hasType("NOTIFICATION_STATE")) {
  34.             Type::addType('NOTIFICATION_STATE''Globunet\NotificationBundle\Entity\DBAL\EnumNotificationState');
  35.             $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('NOTIFICATION_STATE','NOTIFICATION_STATE');
  36.         }
  37.         
  38.         if (!Type::hasType("PLATFORM_TYPE")) {
  39.             Type::addType('PLATFORM_TYPE''Globunet\NotificationBundle\Entity\DBAL\EnumPlatformType');
  40.             $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('PLATFORM_TYPE','PLATFORM_TYPE');
  41.         }
  42.     }
  43. }