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


PHP Index::getName方法代码示例

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


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

示例1: indexToArray

 /**
  * @param string $table
  * @param \Doctrine\DBAL\Schema\Index $index
  * @return array
  */
 protected function indexToArray($table, $index)
 {
     if ($index->isPrimary()) {
         $type = 'primary';
     } elseif ($index->isUnique()) {
         $type = 'unique';
     } else {
         $type = 'index';
     }
     $array = ['type' => $type, 'name' => null, 'columns' => $index->getColumns()];
     if (!$this->isDefaultIndexName($table, $index->getName(), $type, $index->getColumns())) {
         $array['name'] = $index->getName();
     }
     return $array;
 }
开发者ID:19peaches,项目名称:laravel-generator,代码行数:20,代码来源:IndexParser.php

示例2: indexToArray

 /**
  * @param string $table
  * @param \Doctrine\DBAL\Schema\Index $index
  * @return array
  */
 protected function indexToArray($table, $index)
 {
     if ($index->isPrimary()) {
         $type = 'primary';
     } elseif ($index->isUnique()) {
         $type = 'unique';
     } else {
         $type = 'index';
     }
     $array = ['type' => $type, 'name' => null, 'columns' => $index->getColumns()];
     if (!$this->ignoreIndexNames and !$this->isDefaultIndexName($table, $index->getName(), $type, $index->getColumns())) {
         // Sent Index name to exclude spaces
         $array['name'] = str_replace(' ', '', $index->getName());
     }
     return $array;
 }
开发者ID:rohinigeeks,项目名称:laravel-sorcery,代码行数:21,代码来源:IndexGenerator.php

示例3: _addIndex

 /**
  * Add index to table
  * 
  * @param Index $indexCandidate
  * @return Table
  */
 protected function _addIndex(Index $indexCandidate)
 {
     // check for duplicates
     foreach ($this->_indexes as $existingIndex) {
         if ($indexCandidate->isFullfilledBy($existingIndex)) {
             return $this;
         }
     }
     $indexName = $indexCandidate->getName();
     $indexName = strtolower($indexName);
     if (isset($this->_indexes[$indexName]) || $this->_primaryKeyName != false && $indexCandidate->isPrimary()) {
         throw SchemaException::indexAlreadyExists($indexName, $this->_name);
     }
     // remove overruled indexes
     foreach ($this->_indexes as $idxKey => $existingIndex) {
         if ($indexCandidate->overrules($existingIndex)) {
             unset($this->_indexes[$idxKey]);
         }
     }
     if ($indexCandidate->isPrimary()) {
         $this->_primaryKeyName = $indexName;
     }
     $this->_indexes[$indexName] = $indexCandidate;
     return $this;
 }
开发者ID:michaelnavarro,项目名称:zc,代码行数:31,代码来源:Table.php

示例4: dropAndCreateIndex

 /**
  * Drop and create a new index on a table
  *
  * @param string|Table $table         name of the table on which the index is to be created
  * @param Index $index
  */
 public function dropAndCreateIndex(Index $index, $table)
 {
     $this->tryMethod('dropIndex', $index->getName(), $table);
     $this->createIndex($index, $table);
 }
开发者ID:jff15,项目名称:travelbot,代码行数:11,代码来源:AbstractSchemaManager.php

示例5: checkIndex

 /**
  * Do checks for indexes.
  *
  * @param Index         $index
  * @param IgnoredChange $ignoredChange
  *
  * @return boolean
  */
 protected function checkIndex(Index $index, IgnoredChange $ignoredChange)
 {
     // Not needed to be implemented yet
     if ($ignoredChange->getPropertyName() !== $index->getName()) {
         return false;
     }
     return false;
 }
开发者ID:zomars,项目名称:bolt,代码行数:16,代码来源:DiffUpdater.php

示例6: checkIndex

 /**
  * Do checks for indexes.
  *
  * @param Index $index
  * @param array $alterData
  *
  * @return boolean
  */
 protected function checkIndex(Index $index, array $alterData)
 {
     // Not needed to be implemented yet
     if ($alterData['propertyName'] !== $index->getName()) {
         return false;
     }
     return false;
 }
开发者ID:somekoala,项目名称:bolt,代码行数:16,代码来源:DiffUpdater.php

示例7: 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->getName();
     }
     $name = $index->getName();
     $columns = $index->getColumns();
     if (count($columns) == 0) {
         throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
     }
     $type = '';
     if ($index->isUnique()) {
         $type = 'UNIQUE ';
     }
     $query = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table;
     $query .= ' (' . $this->getIndexFieldDeclarationListSQL($columns) . ')';
     return $query;
 }
开发者ID:skoop,项目名称:doctrine2,代码行数:25,代码来源:AbstractPlatform.php

示例8: _addIndex

 /**
  * Adds an index to the table.
  *
  * @param Index $indexCandidate
  *
  * @return self
  *
  * @throws SchemaException
  */
 protected function _addIndex(Index $indexCandidate)
 {
     $indexName = $indexCandidate->getName();
     $indexName = $this->normalizeIdentifier($indexName);
     $replacedImplicitIndexes = array();
     foreach ($this->implicitIndexes as $name => $implicitIndex) {
         if ($implicitIndex->isFullfilledBy($indexCandidate) && isset($this->_indexes[$name])) {
             $replacedImplicitIndexes[] = $name;
         }
     }
     if (isset($this->_indexes[$indexName]) && !in_array($indexName, $replacedImplicitIndexes, true) || $this->_primaryKeyName != false && $indexCandidate->isPrimary()) {
         throw SchemaException::indexAlreadyExists($indexName, $this->_name);
     }
     foreach ($replacedImplicitIndexes as $name) {
         unset($this->_indexes[$name], $this->implicitIndexes[$name]);
     }
     if ($indexCandidate->isPrimary()) {
         $this->_primaryKeyName = $indexName;
     }
     $this->_indexes[$indexName] = $indexCandidate;
     return $this;
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:31,代码来源:Table.php

示例9: saveIndex

 /**
  * @param Index $index
  * @param \SimpleXMLElement $xml
  */
 private static function saveIndex($index, $xml)
 {
     $xml->addChild('name', $index->getName());
     if ($index->isPrimary()) {
         $xml->addChild('primary', 'true');
     } elseif ($index->isUnique()) {
         $xml->addChild('unique', 'true');
     }
     foreach ($index->getColumns() as $column) {
         $field = $xml->addChild('field');
         $field->addChild('name', $column);
         $field->addChild('sorting', 'ascending');
     }
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:18,代码来源:MDB2SchemaWriter.php

示例10: createIndexReplacement

 /**
  * Creates a index replacement, which has quoted names.
  *
  * @param Index $index
  *
  * @return Index
  */
 private function createIndexReplacement(Index $index)
 {
     return new Index($this->platform->quoteIdentifier($index->getName()), $this->quoteIdentifiers($index->getColumns()), $index->isUnique(), $index->isPrimary(), $index->getFlags(), $index->getOptions());
 }
开发者ID:digilist,项目名称:snakedumper,代码行数:11,代码来源:IdentifierQuoter.php

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

示例12: acceptIndex

 /**
  * Accept an index on in a table
  *
  * @param Table $table a table object
  * @param Index $index a column object
  * 
  * @return void
  */
 public function acceptIndex(Table $table, Index $index)
 {
     $this->schemaArray['tables'][$table->getName()]['indexes'][$index->getName()] = array('name' => $index->getName(), 'columns' => $index->getColumns(), 'unique' => $index->isUnique(), 'primary' => $index->isPrimary());
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:12,代码来源:ExportVisitor.php


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