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


PHP ForeignKeyConstraint::getColumns方法代码示例

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


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

示例1: acceptForeignKey

 /**
  * @param Table $localTable
  * @param ForeignKeyConstraint $fkConstraint
  */
 public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
 {
     if ($this->_addExplicitIndexForForeignKey) {
         $columns = $fkConstraint->getColumns();
         if ($localTable->columnsAreIndexed($columns)) {
             return;
         }
         $localTable->addIndex($columns);
     }
 }
开发者ID:jacques-sounvi,项目名称:addressbook,代码行数:14,代码来源:FixSchema.php

示例2: _addForeignKeyConstraint

 /**
  * @param ForeignKeyConstraint $constraint
  */
 protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint)
 {
     $constraint->setLocalTable($this);
     if (strlen($constraint->getName())) {
         $name = $constraint->getName();
     } else {
         $name = $this->_generateIdentifierName(array_merge((array) $this->getName(), $constraint->getLocalColumns()), "fk", $this->_getMaxIdentifierLength());
     }
     $name = strtolower($name);
     $this->_fkConstraints[$name] = $constraint;
     // add an explicit index on the foreign key columns. If there is already an index that fullfils this requirements drop the request.
     // In the case of __construct calling this method during hydration from schema-details all the explicitly added indexes
     // lead to duplicates. This creates compuation overhead in this case, however no duplicate indexes are ever added (based on columns).
     $this->addIndex($constraint->getColumns());
 }
开发者ID:michaelnavarro,项目名称:zc,代码行数:18,代码来源:Table.php

示例3: _addForeignKeyConstraint

 /**
  * @param ForeignKeyConstraint $constraint
  *
  * @return void
  */
 protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint)
 {
     $constraint->setLocalTable($this);
     if (strlen($constraint->getName())) {
         $name = $constraint->getName();
     } else {
         $name = $this->_generateIdentifierName(array_merge((array) $this->getName(), $constraint->getLocalColumns()), "fk", $this->_getMaxIdentifierLength());
     }
     $name = $this->normalizeIdentifier($name);
     $this->_fkConstraints[$name] = $constraint;
     // add an explicit index on the foreign key columns. If there is already an index that fulfils this requirements drop the request.
     // In the case of __construct calling this method during hydration from schema-details all the explicitly added indexes
     // lead to duplicates. This creates computation overhead in this case, however no duplicate indexes are ever added (based on columns).
     $indexName = $this->_generateIdentifierName(array_merge(array($this->getName()), $constraint->getColumns()), "idx", $this->_getMaxIdentifierLength());
     $indexCandidate = $this->_createIndex($constraint->getColumns(), $indexName, false, false);
     foreach ($this->_indexes as $existingIndex) {
         if ($indexCandidate->isFullfilledBy($existingIndex)) {
             return;
         }
     }
     $this->_addIndex($indexCandidate);
     $this->implicitIndexes[$this->normalizeIdentifier($indexName)] = $indexCandidate;
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:28,代码来源:Table.php

示例4: getCreateForeignKeySQL

 /**
  * @param ForeignKeyConstraint $foreignKey
  * @param Table|string         $table
  *
  * @return string
  */
 public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
 {
     $columns = $foreignKey->getColumns();
     $column = reset($columns);
     $column = $table->getColumn($column);
     $sql = array();
     if ($column->hasCustomSchemaOption('definedIn') and $column->getCustomSchemaOption('definedIn') === 'link') {
         $sql = $this->_getCreateColumnSQL($foreignKey->getLocalTableName(), $column->getName(), $column->toArray());
     }
     return $sql;
 }
开发者ID:mihai-stancu,项目名称:orientdb-orm,代码行数:17,代码来源:OrientDBPlatform.php


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