当前位置: 首页>>代码示例>>PHP>>正文


PHP Criterion::getConjunctions方法代码示例

本文整理汇总了PHP中Criterion::getConjunctions方法的典型用法代码示例。如果您正苦于以下问题:PHP Criterion::getConjunctions方法的具体用法?PHP Criterion::getConjunctions怎么用?PHP Criterion::getConjunctions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Criterion的用法示例。


在下文中一共展示了Criterion::getConjunctions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: _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

示例3: 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::getConjunctions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。