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


PHP AbstractPlatform::supportsForeignKeyConstraints方法代碼示例

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


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

示例1: acceptForeignKey

 /**
  * @param Table $localTable
  * @param ForeignKeyConstraint $fkConstraint
  */
 public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
 {
     $namespace = $this->getNamespace($localTable);
     if ($this->_platform->supportsForeignKeyConstraints()) {
         $this->_createFkConstraintQueries[$namespace] = array_merge($this->_createFkConstraintQueries[$namespace], (array) $this->_platform->getCreateForeignKeySQL($fkConstraint, $localTable));
     }
 }
開發者ID:jeanlopes,項目名稱:mostra-ifrs-poa,代碼行數:11,代碼來源:CreateSchemaSqlCollector.php

示例2: acceptForeignKey

 /**
  * @param Table $localTable
  * @param ForeignKeyConstraint $fkConstraint
  */
 public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
 {
     // Append the foreign key constraints SQL
     if ($this->_platform->supportsForeignKeyConstraints()) {
         $this->_createFkConstraintQueries = array_merge($this->_createFkConstraintQueries, (array) $this->_platform->getCreateForeignKeySQL($fkConstraint, $localTable->getName()));
     }
 }
開發者ID:poulikov,項目名稱:readlater,代碼行數:11,代碼來源:CreateSchemaSqlCollector.php

示例3: listTableDetails

 /**
  * @param  string $tableName
  * @return Table
  */
 public function listTableDetails($tableName)
 {
     $columns = $this->listTableColumns($tableName);
     $foreignKeys = array();
     if ($this->_platform->supportsForeignKeyConstraints()) {
         $foreignKeys = $this->listTableForeignKeys($tableName);
     }
     $indexes = $this->listTableIndexes($tableName);
     return new Table($tableName, $columns, $indexes, $foreignKeys, false, array());
 }
開發者ID:jff15,項目名稱:travelbot,代碼行數:14,代碼來源:AbstractSchemaManager.php

示例4: testGeneratesForeignKeySqlOnlyWhenSupportingForeignKeys

 public function testGeneratesForeignKeySqlOnlyWhenSupportingForeignKeys()
 {
     $fk = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(array('fk_name'), 'foreign', array('id'), 'constraint_fk');
     if ($this->_platform->supportsForeignKeyConstraints()) {
         $this->assertInternalType('string', $this->_platform->getCreateForeignKeySQL($fk, 'test'));
     } else {
         $this->setExpectedException('Doctrine\\DBAL\\DBALException');
         $this->_platform->getCreateForeignKeySQL($fk, 'test');
     }
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:10,代碼來源:AbstractPlatformTestCase.php

示例5: listTableDetails

 /**
  * @param  string $tableName
  * @return Table
  */
 public function listTableDetails($tableName)
 {
     $columns = $this->listTableColumns($tableName);
     $foreignKeys = array();
     if ($this->_platform->supportsForeignKeyConstraints()) {
         $foreignKeys = $this->listTableForeignKeys($tableName);
     }
     $indexes = $this->listTableIndexes($tableName);
     $idGeneratorType = Table::ID_NONE;
     foreach ($columns as $column) {
         if ($column->hasPlatformOption('autoincrement') && $column->getPlatformOption('autoincrement')) {
             $idGeneratorType = Table::ID_IDENTITY;
         }
     }
     return new Table($tableName, $columns, $indexes, $foreignKeys, $idGeneratorType, array());
 }
開發者ID:jacques-sounvi,項目名稱:addressbook,代碼行數:20,代碼來源:AbstractSchemaManager.php

示例6: _toSql

 /**
  * @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
  * @param boolean                                   $saveMode
  *
  * @return array
  */
 protected function _toSql(AbstractPlatform $platform, $saveMode = false)
 {
     $sql = array();
     if ($platform->supportsSchemas()) {
         foreach ($this->newNamespaces as $newNamespace) {
             $sql[] = $platform->getCreateSchemaSQL($newNamespace);
         }
     }
     if ($platform->supportsForeignKeyConstraints() && $saveMode == false) {
         foreach ($this->orphanedForeignKeys as $orphanedForeignKey) {
             $sql[] = $platform->getDropForeignKeySQL($orphanedForeignKey, $orphanedForeignKey->getLocalTableName());
         }
     }
     if ($platform->supportsSequences() == true) {
         foreach ($this->changedSequences as $sequence) {
             $sql[] = $platform->getAlterSequenceSQL($sequence);
         }
         if ($saveMode === false) {
             foreach ($this->removedSequences as $sequence) {
                 $sql[] = $platform->getDropSequenceSQL($sequence);
             }
         }
         foreach ($this->newSequences as $sequence) {
             $sql[] = $platform->getCreateSequenceSQL($sequence);
         }
     }
     $foreignKeySql = array();
     foreach ($this->newTables as $table) {
         $sql = array_merge($sql, $platform->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES));
         if ($platform->supportsForeignKeyConstraints()) {
             foreach ($table->getForeignKeys() as $foreignKey) {
                 $foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table);
             }
         }
     }
     $sql = array_merge($sql, $foreignKeySql);
     if ($saveMode === false) {
         foreach ($this->removedTables as $table) {
             $sql[] = $platform->getDropTableSQL($table);
         }
     }
     foreach ($this->changedTables as $tableDiff) {
         $sql = array_merge($sql, $platform->getAlterTableSQL($tableDiff));
     }
     return $sql;
 }
開發者ID:Kevin-ZK,項目名稱:vaneDisk,代碼行數:52,代碼來源:SchemaDiff.php

示例7: acceptForeignKey

 /**
  * {@inheritdoc}
  */
 public function acceptForeignKey(Table $localTable, ForeignKeyConstraint $fkConstraint)
 {
     if ($this->platform->supportsForeignKeyConstraints()) {
         $this->createFkConstraintQueries = array_merge($this->createFkConstraintQueries, (array) $this->platform->getCreateForeignKeySQL($fkConstraint, $localTable));
     }
 }
開發者ID:BusinessCookies,項目名稱:CoffeeMachineProject,代碼行數:9,代碼來源:CreateSchemaSqlCollector.php


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