Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function bake($name)
 {
     EventManager::instance()->on('Bake.initialize', function (Event $event) {
         $event->subject->loadHelper('Migrations.Migration');
     });
     return parent::bake($name);
 }
 /**
  * {@inheritDoc}
  */
 public function bake($name)
 {
     $collection = $this->getCollection($this->connection);
     EventManager::instance()->on('Bake.initialize', function (Event $event) use($collection) {
         $event->subject->loadHelper('Migrations.Migration', ['collection' => $collection]);
     });
     return parent::bake($name);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritDoc}
  */
 public function bake($name)
 {
     $this->setup();
     if (!$this->checkSync()) {
         $this->error('Your migrations history is not in sync with your migrations files. ' . 'Make sure all your migrations have been migrated before baking a diff.');
         return 1;
     }
     if (empty($this->migrationsFiles) && empty($this->migratedItems)) {
         return $this->bakeSnapshot($name);
     }
     $collection = $this->getCollection($this->connection);
     EventManager::instance()->on('Bake.initialize', function (Event $event) use($collection) {
         $event->subject->loadHelper('Migrations.Migration', ['collection' => $collection]);
     });
     return parent::bake($name);
 }