Пример #1
0
 /**
  * Initialize autocreation.
  *
  * @param string      $dir
  * @param string|null $table
  */
 public static function init($dir, $table = null)
 {
     $templates = new TemplatesCollection();
     $templates->registerAutoTemplates();
     $config = ['dir' => $dir, 'table' => is_null($table) ? 'migrations' : $table];
     static::$migrator = new Migrator($config, $templates);
     static::addEventHandlers();
     static::turnOn();
 }
Пример #2
0
 /**
  * Unsets the database migrator for models.
  *
  * @return void
  */
 public static function unsetMigrator()
 {
     static::$migrator = null;
 }