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


PHP Criterion::getClauses方法代碼示例

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


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

示例1: traverseCriterion

 /**
  * method supporting recursion through all criterions to give
  * us an array of them
  * @param      Criterion $c
  * @param      array &$a
  * @return     void
  */
 private function traverseCriterion(Criterion $c, &$a)
 {
     $a[] = $c;
     foreach ($c->getClauses() as $clause) {
         $this->traverseCriterion($clause, $a);
     }
 }
開發者ID:Daniel-Marynicz,項目名稱:symfony1-legacy,代碼行數:14,代碼來源:Criteria.php

示例2: traverseCriterion

 /**
  * method supporting recursion through all criterions to give
  * us an array of them
  * @param Criterion $c
  * @param array &$a
  * @return void
  */
 private function traverseCriterion(Criterion $c, &$a)
 {
     $a[] = $c;
     $clauses = $c->getClauses();
     $clausesLength = count($clauses);
     for ($i = 0; $i < $clausesLength; $i++) {
         $this->traverseCriterion($clauses[$i], $a);
     }
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:16,代碼來源:Criteria.php

示例3: addCriterionTable

 /**
  * method supporting recursion through all criterions to give
  * us a string array of tables from each criterion
  * @return void
  */
 private function addCriterionTable(Criterion $c, array &$s)
 {
     $s[] = $c->getTable();
     foreach ($c->getClauses() as $clause) {
         $this->addCriterionTable($clause, $s);
     }
 }
開發者ID:nevalla,項目名稱:Propel,代碼行數:12,代碼來源:Criterion.php

示例4: addClauses

 /**
  * add inner criteria for criterions 
  * ----------------- IMPORTANT ----------------- 
  *  for this to work - we have to change the access modifier of the Creterion::getClauses() function from private to public
  * It's in the Criteria.php file under
  * 	/symfony/vendor/propel/util/Criteria.php 
  */
 private function addClauses(Criteria $criteria_to_filter, Criterion $filter_criterion, Criterion $crit)
 {
     $conjunctions = $filter_criterion->getConjunctions();
     if (count($conjunctions) < 1) {
         return;
     }
     $clauses = $filter_criterion->getClauses();
     $i = 0;
     foreach ($clauses as $clause) {
         $new_crit = $criteria_to_filter->getNewCriterion($clause->getTable() . "." . $clause->getColumn(), $clause->getValue(), $clause->getComparison());
         $conj = @$conjunctions[$i];
         if ($conj == Criterion::UND) {
             $crit->addAnd($new_crit);
         } elseif ($conj == Criterion::ODER) {
             $crit->addOr($new_crit);
         }
         $i++;
     }
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:26,代碼來源:criteriaFilter.class.php

示例5: _createSqlFromCriterion

 private function _createSqlFromCriterion(Criterion $aCriterion)
 {
     //var_dump( $aCriterion );
     //$this->_hidden_criterion->getTable()
     //		echo $aCriterion->getColumn();
     //		echo $aCriterion->getValue();
     //		echo $aCriterion->getComparison();
     //		var_dump( $aCriterion->getAllTables() );
     //		var_dump( $aCriterion->getAttachedCriterion() );
     //		var_dump( $aCriterion->getTable() );
     $table = $aCriterion->getTable() ? $aCriterion->getTable() . '.' : '';
     $value = $aCriterion->getValue();
     if (is_array($value)) {
         foreach ($value as $key => $val) {
             $value[$key] = "'" . chks($val) . "'";
         }
         if (count($value)) {
             $value = '(' . implode(',', $value) . ')';
         } else {
             $value = '( NULL )';
         }
     } else {
         if (!is_null($value) && !is_numeric($value)) {
             $value = "'" . chks($value) . "'";
         }
     }
     if (is_null($value)) {
         if (self::EQUAL == $aCriterion->getComparison() || self::ISNULL == $aCriterion->getComparison() || self::IN == $aCriterion->getComparison()) {
             $partWhere = trim($table . $aCriterion->getColumn(), '.') . " IS NULL";
         } else {
             $partWhere = trim($table . $aCriterion->getColumn(), '.') . " IS NOT NULL";
         }
     } else {
         $partWhere = trim($table . $aCriterion->getColumn(), '.') . $aCriterion->getComparison() . $value;
     }
     $clauses = $aCriterion->getClauses();
     if (is_array($clauses) && count($clauses)) {
         $conjunctions = $aCriterion->getConjunctions();
         for ($i = 0; $i < count($clauses); $i++) {
             $partWhere = '(' . $partWhere . ')' . $conjunctions[$i] . $this->_createSqlFromCriterion($clauses[$i]);
         }
     }
     return $partWhere;
 }
開發者ID:uwitec,項目名稱:outbuying,代碼行數:44,代碼來源:Searchs.php

示例6: addClauses

 /**
  * add inner criteria for criterions 
  * ----------------- IMPORTANT ----------------- 
  *  for this to work - we have to change the access modifier of the Creterion::getClauses() function from private to public
  * It's in the Criteria.php file under
  * 	/symfony/vendor/propel/util/Criteria.php 
  */
 private function addClauses(Criteria $criteriaToFilter, Criterion $filterCriterion, Criterion $criterion)
 {
     $conjunctions = $filterCriterion->getConjunctions();
     if (count($conjunctions) < 1) {
         return;
     }
     $clauses = $filterCriterion->getClauses();
     $i = 0;
     foreach ($clauses as $clause) {
         if ($clause instanceof KalturaCriterion && !$clause->isEnabled()) {
             continue;
         }
         /* @var $clause Criterion */
         $newCriterion = $criteriaToFilter->getNewCriterion($clause->getTable() . "." . $clause->getColumn(), $clause->getValue(), $clause->getComparison());
         $conj = @$conjunctions[$i];
         if ($conj == Criterion::UND) {
             $criterion->addAnd($newCriterion);
         } elseif ($conj == Criterion::ODER) {
             $criterion->addOr($newCriterion);
         }
         $i++;
     }
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:30,代碼來源:criteriaFilter.class.php


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