當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Blueprint::build方法代碼示例

本文整理匯總了PHP中Illuminate\Database\Schema\Blueprint::build方法的典型用法代碼示例。如果您正苦於以下問題:PHP Blueprint::build方法的具體用法?PHP Blueprint::build怎麽用?PHP Blueprint::build使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Database\Schema\Blueprint的用法示例。


在下文中一共展示了Blueprint::build方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: build

 /**
  * Execute the blueprint to build / modify the table.
  *
  * @param  \Cooperl\Database\DB2\Schema\Blueprint  $blueprint
  * @return void
  */
 protected function build(Blueprint $blueprint)
 {
     $schemaTable = explode(".", $blueprint->getTable());
     if (count($schemaTable) > 1) {
         $this->connection->setCurrentSchema($schemaTable[0]);
     }
     $blueprint->build($this->connection, $this->grammar);
     $this->connection->resetCurrentSchema();
 }
開發者ID:jacksonwebservices,項目名稱:laravel-iseries,代碼行數:15,代碼來源:Builder.php

示例2: build

 /**
  * Execute the blueprint to build / modify the table.
  *
  * @param  \Illuminate\Database\Schema\Blueprint  $blueprint
  * @return void
  */
 protected function build(Blueprint $blueprint)
 {
     $blueprint->build($this->connection, $this->grammar);
 }
開發者ID:davidhemphill,項目名稱:framework,代碼行數:10,代碼來源:Builder.php

示例3: build

 /**
  * Overrride build function
  *
  * @param Connection $connection
  * @param Grammar    $grammar
  */
 public function build(Connection $connection, Grammar $grammar)
 {
     $command = $this->parseCommand($this->commands[0]->get('name'));
     $schema = $connection->getSchemaBuilder();
     if ($command === "drop") {
         $schema->dropIfExists($this->getI18NTableName());
     }
     parent::build($connection, $grammar);
     if ($command === "create") {
         $primary = $this->i18n_primary;
         $i18n_columns = $this->i18n_columns;
         $table_name = $this->table;
         $schema->create($this->getI18NTableName(), function (Blueprint $table) use($table_name, $primary, $i18n_columns) {
             foreach ($primary as $name => $col) {
                 $table->columns[] = $col;
                 $table->foreign($col->get('name'))->references($col->get('name'))->on($table_name)->onDelete('cascade');
             }
             foreach ($i18n_columns as $col) {
                 $table->columns[] = $col;
             }
             $table->string($this->i18n_code_field, 10);
             $table->primary(array_merge(array_keys($primary), [$this->i18n_code_field]));
         });
     }
 }
開發者ID:tuanlq11,項目名稱:dbi18n,代碼行數:31,代碼來源:I18NBlueprint.php


注:本文中的Illuminate\Database\Schema\Blueprint::build方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。