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


PHP Table::temporary方法代碼示例

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


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

示例1: createTableSql

 /**
  * {@inheritDoc}
  */
 public function createTableSql(Table $table, $columns, $constraints, $indexes)
 {
     $lines = array_merge($columns, $constraints);
     $content = implode(",\n", array_filter($lines));
     $temporary = $table->temporary() ? ' TEMPORARY ' : ' ';
     $table = sprintf("CREATE%sTABLE \"%s\" (\n%s\n)", $temporary, $table->name(), $content);
     $out = [$table];
     foreach ($indexes as $index) {
         $out[] = $index;
     }
     return $out;
 }
開發者ID:maitrepylos,項目名稱:nazeweb,代碼行數:15,代碼來源:SqliteSchema.php

示例2: createTableSql

 /**
  * {@inheritDoc}
  */
 public function createTableSql(Table $table, $columns, $constraints, $indexes)
 {
     $content = implode(",\n", array_merge($columns, $constraints, $indexes));
     $temporary = $table->temporary() ? ' TEMPORARY ' : ' ';
     $content = sprintf("CREATE%sTABLE `%s` (\n%s\n)", $temporary, $table->name(), $content);
     $options = $table->options();
     if (isset($options['engine'])) {
         $content .= sprintf(' ENGINE=%s', $options['engine']);
     }
     if (isset($options['charset'])) {
         $content .= sprintf(' DEFAULT CHARSET=%s', $options['charset']);
     }
     if (isset($options['collate'])) {
         $content .= sprintf(' COLLATE=%s', $options['collate']);
     }
     return [$content];
 }
開發者ID:ansidev,項目名稱:cakephp_blog,代碼行數:20,代碼來源:MysqlSchema.php

示例3: createTableSql

 /**
  * {@inheritDoc}
  */
 public function createTableSql(Table $table, $columns, $constraints, $indexes)
 {
     $content = array_merge($columns, $constraints);
     $content = implode(",\n", array_filter($content));
     $tableName = $this->_driver->quoteIdentifier($table->name());
     $temporary = $table->temporary() ? ' TEMPORARY ' : ' ';
     $out = [];
     $out[] = sprintf("CREATE%sTABLE %s (\n%s\n)", $temporary, $tableName, $content);
     foreach ($indexes as $index) {
         $out[] = $index;
     }
     foreach ($table->columns() as $column) {
         $columnData = $table->column($column);
         if (isset($columnData['comment'])) {
             $out[] = sprintf('COMMENT ON COLUMN %s.%s IS %s', $tableName, $this->_driver->quoteIdentifier($column), $this->_driver->schemaValue($columnData['comment']));
         }
     }
     return $out;
 }
開發者ID:juanshot,項目名稱:cakephp,代碼行數:22,代碼來源:PostgresSchema.php

示例4: testTemporary

 /**
  * Tests the temporary() method
  *
  * @return void
  */
 public function testTemporary()
 {
     $table = new Table('articles');
     $this->assertFalse($table->temporary());
     $this->assertSame($table, $table->temporary(true));
     $this->assertTrue($table->temporary());
     $table->temporary(false);
     $this->assertFalse($table->temporary());
 }
開發者ID:neilan35,項目名稱:betterwindow1,代碼行數:14,代碼來源:TableTest.php


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