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


PHP Schema\Sequence類代碼示例

本文整理匯總了PHP中Doctrine\DBAL\Schema\Sequence的典型用法代碼示例。如果您正苦於以下問題:PHP Sequence類的具體用法?PHP Sequence怎麽用?PHP Sequence使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: testIsAutoincrementFor

 /**
  * @group DDC-1657
  */
 public function testIsAutoincrementFor()
 {
     $table = new Table("foo");
     $table->addColumn("id", "integer", array("autoincrement" => true));
     $table->setPrimaryKey(array("id"));
     $sequence = new Sequence("foo_id_seq");
     $sequence2 = new Sequence("bar_id_seq");
     $sequence3 = new Sequence("other.foo_id_seq");
     $this->assertTrue($sequence->isAutoIncrementsFor($table));
     $this->assertFalse($sequence2->isAutoIncrementsFor($table));
     $this->assertFalse($sequence3->isAutoIncrementsFor($table));
 }
開發者ID:llinder,項目名稱:FrameworkBenchmarks,代碼行數:15,代碼來源:SequenceTest.php

示例2: getSequenceCacheSQL

 /**
  * Cache definition for sequences
  *
  * @param Sequence $sequence
  *
  * @return string
  */
 private function getSequenceCacheSQL(Sequence $sequence)
 {
     if ($sequence->getCache() > 1) {
         return ' CACHE ' . $sequence->getCache();
     }
     return '';
 }
開發者ID:cuppyzh,項目名稱:go_laundry,代碼行數:14,代碼來源:PostgreSqlPlatform.php

示例3: _addSequence

 /**
  * @param \Doctrine\DBAL\Schema\Sequence $sequence
  *
  * @return void
  *
  * @throws \Doctrine\DBAL\Schema\SchemaException
  */
 protected function _addSequence(Sequence $sequence)
 {
     $seqName = $sequence->getFullQualifiedName($this->getName());
     if (isset($this->_sequences[$seqName])) {
         throw SchemaException::sequenceAlreadyExists($seqName);
     }
     $this->_sequences[$seqName] = $sequence;
 }
開發者ID:neteasy-work,項目名稱:hkgbf_crm,代碼行數:15,代碼來源:Schema.php

示例4: dropAndCreateSequence

 /**
  * Drops and create a new sequence.
  *
  * @param \Doctrine\DBAL\Schema\Sequence $sequence
  *
  * @return void
  *
  * @throws \Doctrine\DBAL\ConnectionException If something fails at database level.
  */
 public function dropAndCreateSequence(Sequence $sequence)
 {
     $this->tryMethod('dropSequence', $sequence->getQuotedName($this->_platform));
     $this->createSequence($sequence);
 }
開發者ID:tamboer,項目名稱:LaravelOctober,代碼行數:14,代碼來源:AbstractSchemaManager.php

示例5: getSequenceCacheSQL

 /**
  * Cache definition for sequences
  *
  * @param Sequence $sequence
  *
  * @return string
  */
 private function getSequenceCacheSQL(Sequence $sequence)
 {
     if ($sequence->getCache() === 0) {
         return ' NOCACHE';
     } else {
         if ($sequence->getCache() === 1) {
             return ' NOCACHE';
         } else {
             if ($sequence->getCache() > 1) {
                 return ' CACHE ' . $sequence->getCache();
             }
         }
     }
     return '';
 }
開發者ID:CynthiaAlwenge,項目名稱:Todo-App,代碼行數:22,代碼來源:OraclePlatform.php

示例6: diffSequence

 /**
  * @param \Doctrine\DBAL\Schema\Sequence $sequence1
  * @param \Doctrine\DBAL\Schema\Sequence $sequence2
  *
  * @return boolean
  */
 public function diffSequence(Sequence $sequence1, Sequence $sequence2)
 {
     if ($sequence1->getAllocationSize() != $sequence2->getAllocationSize()) {
         return true;
     }
     if ($sequence1->getInitialValue() != $sequence2->getInitialValue()) {
         return true;
     }
     return false;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:16,代碼來源:Comparator.php

示例7: isAutoIncrementSequenceInSchema

 /**
  * @param \Doctrine\DBAL\Schema\Schema   $schema
  * @param \Doctrine\DBAL\Schema\Sequence $sequence
  *
  * @return boolean
  */
 private function isAutoIncrementSequenceInSchema($schema, $sequence)
 {
     foreach ($schema->getTables() as $table) {
         if ($sequence->isAutoIncrementsFor($table)) {
             return true;
         }
     }
     return false;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:15,代碼來源:Comparator.php

示例8: acceptSequence

 /**
  * @param Sequence $sequence
  */
 public function acceptSequence(Sequence $sequence)
 {
     $this->_sequences[] = $this->_platform->getDropSequenceSQL($sequence->getQuotedName($this->_platform));
 }
開發者ID:MarS2806,項目名稱:Zend-Framework--Doctrine-ORM--PHPUnit--Ant--Jenkins-CI--TDD-,代碼行數:7,代碼來源:DropSchemaSqlCollector.php

示例9: testReturnsSequenceSQL

 public function testReturnsSequenceSQL()
 {
     $sequence = new Sequence('test_seq', 1, 10);
     $this->assertEquals('CREATE SEQUENCE ' . $sequence->getQuotedName($this->_platform) . ' START WITH ' . $sequence->getInitialValue() . ' INCREMENT BY ' . $sequence->getAllocationSize() . ' MINVALUE ' . $sequence->getInitialValue(), $this->_platform->getCreateSequenceSQL($sequence));
     $this->assertEquals('ALTER SEQUENCE ' . $sequence->getQuotedName($this->_platform) . ' INCREMENT BY ' . $sequence->getAllocationSize(), $this->_platform->getAlterSequenceSQL($sequence));
     $this->assertEquals('DROP SEQUENCE ' . $sequence->getName(), $this->_platform->getDropSequenceSQL($sequence));
     $this->assertEquals('DROP SEQUENCE ' . $sequence->getName(), $this->_platform->getDropSequenceSQL($sequence->getName()));
 }
開發者ID:josemalonsom,項目名稱:ifx4dd,代碼行數:8,代碼來源:InformixPlatformTest.php

示例10: acceptSequence

 /**
  * {@inheritdoc}
  */
 public function acceptSequence(Sequence $sequence)
 {
     if (!$sequence->isInDefaultNamespace($this->schema->getName())) {
         $this->schema->dropSequence($sequence->getName());
     }
 }
開發者ID:Kevin-ZK,項目名稱:vaneDisk,代碼行數:9,代碼來源:RemoveNamespacedAssets.php

示例11: _addSequence

 /**
  * @param \Doctrine\DBAL\Schema\Sequence $sequence
  *
  * @return void
  *
  * @throws \Doctrine\DBAL\Schema\SchemaException
  */
 protected function _addSequence(Sequence $sequence)
 {
     $namespaceName = $sequence->getNamespaceName();
     $seqName = $sequence->getFullQualifiedName($this->getName());
     if (isset($this->_sequences[$seqName])) {
         throw SchemaException::sequenceAlreadyExists($seqName);
     }
     if (!$sequence->isInDefaultNamespace($this->getName()) && !$this->hasNamespace($namespaceName)) {
         $this->createNamespace($namespaceName);
     }
     $this->_sequences[$seqName] = $sequence;
 }
開發者ID:BacLuc,項目名稱:newGryfiPage,代碼行數:19,代碼來源:Schema.php

示例12: acceptSequence

 /**
  * @param Sequence $sequence
  */
 public function acceptSequence(Sequence $sequence)
 {
     $this->_sequences[] = $this->_platform->getDropSequenceSql($sequence->getName());
 }
開發者ID:nvdnkpr,項目名稱:symfony-demo,代碼行數:7,代碼來源:DropSchemaSqlCollector.php

示例13: getCreateSequenceSQL

 /**
  * {@inheritDoc}
  *
  * Need to specifiy minvalue, since start with is hidden in the system and MINVALUE <= START WITH.
  * Therefore we can use MINVALUE to be able to get a hint what START WITH was for later introspection
  * in {@see listSequences()}
  */
 public function getCreateSequenceSQL(Sequence $sequence)
 {
     return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . ' START WITH ' . $sequence->getInitialValue() . ' MINVALUE ' . $sequence->getInitialValue() . ' INCREMENT BY ' . $sequence->getAllocationSize() . $this->getSequenceCacheSQL($sequence);
 }
開發者ID:betes-curieuses-design,項目名稱:ElieJosiePhotographie,代碼行數:11,代碼來源:OraclePlatform.php

示例14: getAlterSequenceSQL

 /**
  * {@inheritDoc}
  */
 public function getAlterSequenceSQL(Sequence $sequence)
 {
     return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . ' INCREMENT BY ' . $sequence->getAllocationSize() . $this->getSequenceCacheSQL($sequence);
 }
開發者ID:BozzaCoon,項目名稱:SPHERE-Framework,代碼行數:7,代碼來源:PostgreSqlPlatform.php

示例15: getAlterSequenceSQL

 public function getAlterSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence)
 {
     return 'ALTER SEQUENCE ' . $sequence->getQuotedName($this) . ' INCREMENT BY ' . $sequence->getAllocationSize();
 }
開發者ID:SerdarSanri,項目名稱:doctrine-bundle,代碼行數:4,代碼來源:OraclePlatform.php


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