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


PHP Index::getQuotedColumns方法代碼示例

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


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

示例1: getSql

 public function getSql(Index $index, $table)
 {
     if ($table instanceof Table) {
         $table = $table->getQuotedName($this->platform);
     }
     $name = $index->getQuotedName($this->platform);
     $columns = $index->getQuotedColumns($this->platform);
     if (count($columns) == 0) {
         throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
     }
     if ($index->isPrimary()) {
         return $this->platform->getCreatePrimaryKeySQL($index, $table);
     }
     $query = 'CREATE INDEX ' . $name . ' ON ' . $table;
     $query .= ' USING gist(' . $this->platform->getIndexFieldDeclarationListSQL($columns) . ')';
     return $query;
 }
開發者ID:novikovsergey,項目名稱:doctrine-postgis,代碼行數:17,代碼來源:SpatialIndexSqlGenerator.php

示例2: _appendUniqueConstraintDefinition

 /**
  * Extend unique key constraint with required filters
  *
  * @param string                      $sql
  * @param \Doctrine\DBAL\Schema\Index $index
  *
  * @return string
  */
 private function _appendUniqueConstraintDefinition($sql, Index $index)
 {
     $fields = array();
     foreach ($index->getQuotedColumns($this) as $field) {
         $fields[] = $field . ' IS NOT NULL';
     }
     return $sql . ' WHERE ' . implode(' AND ', $fields);
 }
開發者ID:aleguisf,項目名稱:fvdev1,代碼行數:16,代碼來源:SQLServerPlatform.php

示例3: getIndexDeclarationSQL

 /**
  * Obtains DBMS specific SQL code portion needed to set an index
  * declaration to be used in statements like CREATE TABLE.
  *
  * @param string                       $name  The name of the index.
  * @param \Doctrine\DBAL\Schema\Index  $index The index definition.
  *
  * @return string DBMS specific SQL code portion needed to set an index.
  *
  * @throws \InvalidArgumentException
  */
 public function getIndexDeclarationSQL($name, Index $index)
 {
     $columns = $index->getQuotedColumns($this);
     if (count($columns) === 0) {
         throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
     }
     return $this->getCreateIndexSQLFlags($index) . 'INDEX ' . $name . ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')' . $this->getPartialIndexSQL($index);
 }
開發者ID:aleguisf,項目名稱:fvdev1,代碼行數:19,代碼來源:AbstractPlatform.php

示例4: getCreatePrimaryKeySQL

 public function getCreatePrimaryKeySQL(Index $index, $table)
 {
     if ($table instanceof Table) {
         $table = $table->getQuotedName($this);
     }
     return 'ALTER TABLE ' . $this->espoQuote($table) . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getQuotedColumns($this)) . ')';
 }
開發者ID:disearth,項目名稱:espocrm,代碼行數:7,代碼來源:MySqlPlatform.php

示例5: getIndexDeclarationSQL

 /**
  * Generate table index column declaration
  * @codeCoverageIgnore
  */
 public function getIndexDeclarationSQL($name, Index $index)
 {
     $columns = $index->getQuotedColumns($this);
     $name = new Identifier($name);
     if (count($columns) == 0) {
         throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
     }
     return 'INDEX ' . $name->getQuotedName($this) . ' USING FULLTEXT (' . $this->getIndexFieldDeclarationListSQL($columns) . ')';
 }
開發者ID:crate,項目名稱:crate-dbal,代碼行數:13,代碼來源:CratePlatform.php

示例6: getCreatePrimaryKeySQL

 /**
  * Returns the SQL to create an unnamed primary key constraint.
  *
  * @param \Doctrine\DBAL\Schema\Index        $index
  * @param \Doctrine\DBAL\Schema\Table|string $table
  *
  * @return string
  */
 public function getCreatePrimaryKeySQL(Index $index, $table)
 {
     return 'ALTER TABLE ' . $table . ' ADD PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getQuotedColumns($this)) . ')';
 }
開發者ID:BozzaCoon,項目名稱:SPHERE-Framework,代碼行數:12,代碼來源:AbstractPlatform.php

示例7: getCreatePrimaryKeySQL

 /**
  * {@inheritDoc}
  */
 public function getCreatePrimaryKeySQL(Index $index, $table)
 {
     $sql = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT PRIMARY KEY (' . $this->getIndexFieldDeclarationListSQL($index->getQuotedColumns($this)) . ')';
     if ($index->getName()) {
         $sql .= ' CONSTRAINT ' . $index->getQuotedName($this);
     }
     return $sql;
 }
開發者ID:josemalonsom,項目名稱:ifx4dd,代碼行數:11,代碼來源:InformixPlatform.php


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