本文整理匯總了PHP中Criterion::addAnd方法的典型用法代碼示例。如果您正苦於以下問題:PHP Criterion::addAnd方法的具體用法?PHP Criterion::addAnd怎麽用?PHP Criterion::addAnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Criterion
的用法示例。
在下文中一共展示了Criterion::addAnd方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addAnd
public function addAnd(Criterion $criterion)
{
if ($criterion instanceof KalturaCriterion) {
$criterion->setParentCriterion($this);
$criterion->setSelfConjunction(self::UND);
}
return parent::addAnd($criterion);
}
示例2: addHiddenSearch
/**
* 增加默認的搜索條件
*
* @param string|Criterion $dbColName
* @param string $value
* @param Watt_Util_Grid_Searchs::Const $type
*/
public function addHiddenSearch($dbColName, $value = null, $comparison = self::EQUAL, $isOr = false)
{
/**
* 這樣將覆蓋同 $dbColName 的條件
*/
//$this->_criteria->add( $dbColName, $value, $type );
/**
* 這樣將不覆蓋同 $dbColName 的條件
*/
if ($dbColName instanceof Criterion) {
$newCriterion = $dbColName;
} else {
$newCriterion = $this->_criteria->getNewCriterion($dbColName, $value, $comparison);
}
if ($this->_hidden_criterion) {
//$this->_hidden_criterion->addAnd( $newCriterion ); // _hidden_criterion 都必須是 and //錯誤判斷,不僅僅如此
if ($isOr) {
$this->_hidden_criterion->addOr($newCriterion);
} else {
$this->_hidden_criterion->addAnd($newCriterion);
}
} else {
$this->_hidden_criterion = $newCriterion;
}
}
示例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 $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++;
}
}
示例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 $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++;
}
}