本文整理汇总了PHP中Criterion::setSelfMatchOperator方法的典型用法代码示例。如果您正苦于以下问题:PHP Criterion::setSelfMatchOperator方法的具体用法?PHP Criterion::setSelfMatchOperator怎么用?PHP Criterion::setSelfMatchOperator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criterion
的用法示例。
在下文中一共展示了Criterion::setSelfMatchOperator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addOr
public function addOr(Criterion $criterion)
{
$currentField = $this->getTable() . '.' . $this->getColumn();
$addedField = $this->getTable() . '.' . $this->getColumn();
KalturaLog::debug("Add OR criterion field [{$addedField}] to current field [{$currentField}]");
// Validate that the added criterion and the current criterios are both attributes or both matches
if ($this->criteria->hasSphinxFieldName($addedField)) {
$currentSphinxField = $this->criteria->getSphinxFieldName($currentField);
$addedSphinxField = $this->criteria->getSphinxFieldName($addedField);
if ($currentSphinxField != $addedSphinxField) {
KalturaLog::debug("Current sphinx field [{$currentSphinxField}] and added sphinx field [{$addedField}]");
$currentType = $this->criteria->getSphinxFieldType($currentSphinxField);
$addedType = $this->criteria->getSphinxFieldType($addedField);
if ($currentType != $addedType) {
KalturaLog::debug("Current type [{$currentType}] and added type [{$addedType}]");
if ($currentType == IIndexable::FIELD_TYPE_STRING || $addedType == IIndexable::FIELD_TYPE_STRING) {
throw new kCoreException("Cannot mix OR operator on attributes and matches", kCoreException::INVALID_QUERY);
}
}
}
}
if ($criterion instanceof SphinxCriterion) {
$criterion->setSelfMatchOperator(self::SPHINX_OR);
}
return parent::addOr($criterion);
}