SHARE
TWEET

Migrations/Schema/v1_0/BPCalendarBundle.php

a guest Jun 27th, 2015 19 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. namespace BP\CalendarBundle\Migrations\Schema\v1_0;
  4.  
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtension;
  7. use Oro\Bundle\EntityExtendBundle\Migration\Extension\ExtendExtensionAwareInterface;
  8. use Oro\Bundle\MigrationBundle\Migration\Migration;
  9. use Oro\Bundle\MigrationBundle\Migration\QueryBag;
  10. use Oro\Bundle\EntityExtendBundle\EntityConfig\ExtendScope;
  11.  
  12. class BPCalendarBundle implements Migration, ExtendExtensionAwareInterface
  13. {
  14.     protected $extendExtension;
  15.  
  16.     public function setExtendExtension(ExtendExtension $extendExtension)
  17.     {
  18.         $this->extendExtension = $extendExtension;
  19.     }
  20.  
  21.     public function up(Schema $schema, QueryBag $queries)
  22.     {
  23.         $table = $schema->getTable('oro_calendar_event');
  24.  
  25.         $this->extendExtension->addManyToOneRelation(
  26.             $schema,
  27.             $table,
  28.             'contact',
  29.             'orocrm_contact',
  30.             'id',
  31.             [
  32.                 'extend' => ['owner' => ExtendScope::OWNER_CUSTOM]
  33.             ]
  34.         );
  35.  
  36.         $this->extendExtension->addEnumField(
  37.             $schema,
  38.             $table,
  39.             'type',
  40.             'calendar_event_type',
  41.             false,
  42.             false,
  43.             [
  44.                 'extend' => ['owner' => ExtendScope::OWNER_CUSTOM]
  45.             ]
  46.         );
  47.     }
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top