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


PHP Index::isFullfilledBy方法代碼示例

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


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

示例1: testFullfilledWithPartial

 public function testFullfilledWithPartial()
 {
     $without = new Index('without', array('col1', 'col2'), true, false, array(), array());
     $partial = new Index('partial', array('col1', 'col2'), true, false, array(), array('where' => 'col1 IS NULL'));
     $another = new Index('another', array('col1', 'col2'), true, false, array(), array('where' => 'col1 IS NULL'));
     $this->assertFalse($partial->isFullfilledBy($without));
     $this->assertFalse($without->isFullfilledBy($partial));
     $this->assertTrue($partial->isFullfilledBy($partial));
     $this->assertTrue($partial->isFullfilledBy($another));
     $this->assertTrue($another->isFullfilledBy($partial));
 }
開發者ID:selimcr,項目名稱:servigases,代碼行數:11,代碼來源:IndexTest.php

示例2: _addIndex

 /**
  * Add index to table
  * 
  * @param Index $indexCandidate
  * @return Table
  */
 protected function _addIndex(Index $indexCandidate)
 {
     // check for duplicates
     foreach ($this->_indexes as $existingIndex) {
         if ($indexCandidate->isFullfilledBy($existingIndex)) {
             return $this;
         }
     }
     $indexName = $indexCandidate->getName();
     $indexName = strtolower($indexName);
     if (isset($this->_indexes[$indexName]) || $this->_primaryKeyName != false && $indexCandidate->isPrimary()) {
         throw SchemaException::indexAlreadyExists($indexName, $this->_name);
     }
     // remove overruled indexes
     foreach ($this->_indexes as $idxKey => $existingIndex) {
         if ($indexCandidate->overrules($existingIndex)) {
             unset($this->_indexes[$idxKey]);
         }
     }
     if ($indexCandidate->isPrimary()) {
         $this->_primaryKeyName = $indexName;
     }
     $this->_indexes[$indexName] = $indexCandidate;
     return $this;
 }
開發者ID:michaelnavarro,項目名稱:zc,代碼行數:31,代碼來源:Table.php

示例3: diffIndex

 /**
  * Finds the difference between the indexes $index1 and $index2.
  *
  * Compares $index1 with $index2 and returns $index2 if there are any
  * differences or false in case there are no differences.
  *
  * @param \Doctrine\DBAL\Schema\Index $index1
  * @param \Doctrine\DBAL\Schema\Index $index2
  *
  * @return boolean
  */
 public function diffIndex(Index $index1, Index $index2)
 {
     if ($index1->isFullfilledBy($index2) && $index2->isFullfilledBy($index1)) {
         return false;
     }
     return true;
 }
開發者ID:kirkbauer2,項目名稱:kirkxc,代碼行數:18,代碼來源:Comparator.php


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