当前位置: 首页>>代码示例>>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;未经允许,请勿转载。