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


PHP Index::getQuotedName方法代码示例

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


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

示例1: getCreateSpatialIndexSQL

 /**
  * Generates the sql to create a spatial index.
  * 
  * @param SpatialIndex $index
  * @param Table | string $table
  * @return string The sql to create a spatial index on the database.
  * @throws \InvalidArgumentException
  */
 public function getCreateSpatialIndexSQL(Index $index, $table)
 {
     if ($table instanceof Table) {
         $table = $table->getQuotedName($this);
     }
     $name = $index->getQuotedName($this);
     $columns = $index->getColumns();
     if (count($columns) == 0) {
         throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
     }
     $query = 'CREATE INDEX ' . $name . ' ON ' . $table;
     $query .= ' USING GIST (' . $this->getIndexFieldDeclarationListSQL($columns) . ')';
     return $query;
 }
开发者ID:agnetsolutions,项目名称:dbal,代码行数:22,代码来源:PostGISPlatform.php

示例2: 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

示例3: getRenameIndexSQL

 /**
  * {@inheritdoc}
  */
 protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
 {
     return array('ALTER INDEX ' . $oldIndexName . ' ON ' . $tableName . ' RENAME TO ' . $index->getQuotedName($this));
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:7,代码来源:SQLAnywherePlatform.php

示例4: getRenameIndexSQL

 /**
  * {@inheritdoc}
  */
 protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
 {
     if (strpos($tableName, '.') !== false) {
         list($schema) = explode('.', $tableName);
         $oldIndexName = $schema . '.' . $oldIndexName;
     }
     return array('ALTER INDEX ' . $oldIndexName . ' RENAME TO ' . $index->getQuotedName($this));
 }
开发者ID:cuppyzh,项目名称:go_laundry,代码行数:11,代码来源:PostgreSqlPlatform.php

示例5: getRenameIndexSQL

 /**
  * {@inheritdoc}
  */
 protected function getRenameIndexSQL($oldIndexName, Index $index, $tableName)
 {
     return array(sprintf("EXEC sp_RENAME N'%s.%s', N'%s', N'INDEX'", $tableName, $oldIndexName, $index->getQuotedName($this)));
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:7,代码来源:SQLServerPlatform.php

示例6: getCreateIndexSQL

 /**
  * Gets the SQL to create an index on a table on this platform.
  *
  * @param Index $index
  * @param string|Table $table name of the table on which the index is to be created
  * @return string
  */
 public function getCreateIndexSQL(Index $index, $table)
 {
     if ($table instanceof Table) {
         $table = $table->getQuotedName($this);
     }
     $name = $index->getQuotedName($this);
     $columns = $index->getColumns();
     if (count($columns) == 0) {
         throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
     }
     if ($index->isPrimary()) {
         return $this->getCreatePrimaryKeySQL($index, $table);
     } else {
         $type = '';
         if ($index->isUnique()) {
             $type = 'UNIQUE ';
         }
         $query = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table;
         $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')';
     }
     return $query;
 }
开发者ID:pollux1er,项目名称:dlawebdev2,代码行数:29,代码来源:AbstractPlatform.php

示例7: dropAndCreateIndex

 /**
  * Drops and creates a new index on a table.
  *
  * @param \Doctrine\DBAL\Schema\Index        $index
  * @param \Doctrine\DBAL\Schema\Table|string $table The name of the table on which the index is to be created.
  *
  * @return void
  */
 public function dropAndCreateIndex(Index $index, $table)
 {
     $this->tryMethod('dropIndex', $index->getQuotedName($this->_platform), $table);
     $this->createIndex($index, $table);
 }
开发者ID:tamboer,项目名称:LaravelOctober,代码行数:13,代码来源:AbstractSchemaManager.php

示例8: getDropIndexSQL

 /**
  * Gets the SQL to drop an index of a table.
  *
  * @param Index $index           name of the index to be dropped
  * @param string|Table $table          name of table that should be used in method
  * @override
  */
 public function getDropIndexSQL($index, $table = null)
 {
     if ($index instanceof Index) {
         $indexName = $index->getQuotedName($this);
     } else {
         if (is_string($index)) {
             $indexName = $index;
         } else {
             throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \\Doctrine\\DBAL\\Schema\\Index.');
         }
     }
     if ($table instanceof Table) {
         $table = $table->getQuotedName($this);
     } else {
         if (!is_string($table)) {
             throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \\Doctrine\\DBAL\\Schema\\Table.');
         }
     }
     if ($index instanceof Index && $index->isPrimary()) {
         // mysql primary keys are always named "PRIMARY",
         // so we cannot use them in statements because of them being keyword.
         return $this->getDropPrimaryKeySQL($table);
     }
     return 'DROP INDEX ' . $indexName . ' ON ' . $table;
 }
开发者ID:rodmen,项目名称:dbal,代码行数:32,代码来源:MySqlPlatform.php

示例9: 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::getQuotedName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。