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


PHP AbstractPlatform::getCreateConstraintSQL方法代碼示例

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


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

示例1: dumpConstraints

 /**
  * Dump the constraints / foreign keys of all tables.
  *
  * The constraints should be created at the end to speed up the import of the dump.
  *
  * @param Table[]            $tables
  */
 public function dumpConstraints(array $tables)
 {
     foreach ($tables as $table) {
         foreach ($table->getForeignKeys() as $constraint) {
             $constraint = $this->platform->getCreateConstraintSQL($constraint, $table);
             $this->dumpOutput->writeln($constraint . ';');
         }
     }
 }
開發者ID:digilist,項目名稱:snakedumper,代碼行數:16,代碼來源:StructureDumper.php

示例2: testGeneratesConstraintCreationSql

 public function testGeneratesConstraintCreationSql()
 {
     $idx = new \Doctrine\DBAL\Schema\Index('constraint_name', array('test'), true, false);
     $sql = $this->_platform->getCreateConstraintSQL($idx, 'test');
     $this->assertEquals($this->getGenerateConstraintUniqueIndexSql(), $sql);
     $pk = new \Doctrine\DBAL\Schema\Index('constraint_name', array('test'), true, true);
     $sql = $this->_platform->getCreateConstraintSQL($pk, 'test');
     $this->assertEquals($this->getGenerateConstraintPrimaryIndexSql(), $sql);
     $fk = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(array('fk_name'), 'foreign', array('id'), 'constraint_fk');
     $sql = $this->_platform->getCreateConstraintSQL($fk, 'test');
     $this->assertEquals($this->getGenerateConstraintForeignKeySql($fk), $sql);
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:12,代碼來源:AbstractPlatformTestCase.php

示例3: createConstraint

 /**
  * Create a constraint on a table
  *
  * @param Constraint $constraint
  * @param string|Table $table
  */
 public function createConstraint(Constraint $constraint, $table)
 {
     $this->_execSql($this->_platform->getCreateConstraintSQL($constraint, $table));
 }
開發者ID:jff15,項目名稱:travelbot,代碼行數:10,代碼來源:AbstractSchemaManager.php

示例4: getCreateConstraintSQL

 /**
  * {@inheritDoc}
  */
 public function getCreateConstraintSQL(Constraint $constraint, $table)
 {
     $constraintSql = parent::getCreateConstraintSQL($constraint, $table);
     return $this->repositionContraintNameSQL($constraint, $constraintSql);
 }
開發者ID:josemalonsom,項目名稱:ifx4dd,代碼行數:8,代碼來源:InformixPlatform.php


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