/** * 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(); }
/** * Unsets the database migrator for models. * * @return void */ public static function unsetMigrator() { static::$migrator = null; }