当前位置: 首页>>代码示例>>PHP>>正文


PHP Migrator::resolve方法代码示例

本文整理汇总了PHP中Illuminate\Database\Migrations\Migrator::resolve方法的典型用法代码示例。如果您正苦于以下问题:PHP Migrator::resolve方法的具体用法?PHP Migrator::resolve怎么用?PHP Migrator::resolve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Database\Migrations\Migrator的用法示例。


在下文中一共展示了Migrator::resolve方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: resolve

 public function resolve($file)
 {
     /* @var $class \Consolet\Migrator\Migration */
     $class = parent::resolve($file);
     $class::setSchemaOnce($this->resolveConnection(null)->getSchemaBuilder());
     return $class;
 }
开发者ID:yusukezzz,项目名称:migrator,代码行数:7,代码来源:Migrator.php

示例2: resolve

 /**
  * Resolve a migration instance from a file.
  *
  * @param  string $file
  *
  * @return Migration
  */
 public function resolve($file)
 {
     $this->requireOnce($file);
     if (!str_is('*.*.*', $file)) {
         return parent::resolve($file);
     }
     return app($this->dispatch(new TransformMigrationNameToClass($this->removeDatePrefix($file))));
 }
开发者ID:jacksun101,项目名称:streams-platform,代码行数:15,代码来源:Migrator.php

示例3: resetMigrations

 /**
  * Reset the migrations for the extension with an
  * optional customized path.
  *
  * @param  string  $path
  * @return void
  */
 protected function resetMigrations($path = null)
 {
     if (!isset(static::$migrator)) {
         return;
     }
     $path = $path ?: $this->getMigrationsPath();
     $files = static::$migrator->getMigrationFiles($path);
     $repository = static::$migrator->getRepository();
     // Get an array of migration names which will be
     // reset
     $migrations = array_intersect(array_reverse($repository->getRan()), $files);
     // Loop through the migrations we have to rollback
     foreach ($migrations as $migration) {
         // Let the migrator resolve the migration instance
         $instance = static::$migrator->resolve($migration);
         // And we'll call the down method on the migration
         $instance->down();
         // Now we need to manipulate what the migrator does to
         // delete a migration.
         $migrationClass = new \StdClass();
         $migrationClass->migration = $migration;
         $repository->delete($migrationClass);
     }
 }
开发者ID:sohailaammarocs,项目名称:lfc,代码行数:31,代码来源:Extension.php


注:本文中的Illuminate\Database\Migrations\Migrator::resolve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。