示例#1
0
 public function translateSphinxCriterion(SphinxCriterion $crit)
 {
     $field = $crit->getTable() . '.' . $crit->getColumn();
     $value = $crit->getValue();
     $fieldName = null;
     if ($field == TagPeer::OBJECT_TYPE) {
         $fieldName = "TagPeer::OBJECT_TYPE";
     }
     if ($field == TagPeer::PRIVACY_CONTEXT) {
         $fieldName = "TagPeer::PRIVACY_CONTEXT";
     }
     if ($fieldName) {
         $partnerIdCrit = $this->getCriterion(TagPeer::PARTNER_ID);
         if ($partnerIdCrit && $partnerIdCrit->getComparison() == Criteria::EQUAL) {
             $partnerId = $partnerIdCrit->getValue();
         } else {
             $partnerId = kCurrentContext::getCurrentPartnerId();
         }
         $value = Tag::getIndexedFieldValue($fieldName, $value, $partnerId);
     }
     if ($field == TagPeer::TAG && in_array($crit->getComparison(), array(Criteria::EQUAL, Criteria::IN))) {
         $value = str_replace(kTagFlowManager::$specialCharacters, kTagFlowManager::$specialCharactersReplacement, $value);
     }
     return array($field, $crit->getComparison(), $value);
 }
 public function translateSphinxCriterion(SphinxCriterion $crit)
 {
     $field = $crit->getTable() . '.' . $crit->getColumn();
     if ($field == categoryPeer::FULL_NAME && $crit->getComparison() == Criteria::EQUAL) {
         return array(categoryPeer::FULL_NAME, Criteria::LIKE, $crit->getValue() . category::FULL_NAME_EQUAL_MATCH_STRING);
     } else {
         if ($field == categoryPeer::FULL_NAME && $crit->getComparison() == Criteria::IN) {
             return array(categoryPeer::FULL_NAME, Criteria::IN_LIKE, kString::addSuffixToArray($crit->getValue(), category::FULL_NAME_EQUAL_MATCH_STRING));
         } else {
             if ($field == categoryPeer::DISPLAY_IN_SEARCH && $crit->getComparison() == Criteria::EQUAL) {
                 $partnerId = kCurrentContext::getCurrentPartnerId();
                 return array(categoryPeer::DISPLAY_IN_SEARCH, Criteria::EQUAL, $crit->getValue() . "P" . $partnerId);
             }
         }
     }
     return parent::translateSphinxCriterion($crit);
 }
示例#3
0
 public function translateSphinxCriterion(SphinxCriterion $crit)
 {
     return array($crit->getTable() . '.' . $crit->getColumn(), $crit->getComparison(), $crit->getValue());
 }
 public function translateSphinxCriterion(SphinxCriterion $crit)
 {
     $field = $crit->getTable() . '.' . $crit->getColumn();
     $value = $crit->getValue();
     $fieldName = null;
     if ($field == categoryKuserPeer::STATUS) {
         $fieldName = categoryKuserPeer::STATUS;
     }
     if ($fieldName) {
         $partnerIdCrit = $this->getCriterion(categoryKuserPeer::PARTNER_ID);
         if ($partnerIdCrit && $partnerIdCrit->getComparison() == Criteria::EQUAL) {
             $partnerId = $partnerIdCrit->getValue();
         } else {
             $partnerId = kCurrentContext::getCurrentPartnerId();
         }
         if (is_array($value)) {
             foreach ($value as &$singleValue) {
                 $singleValue = categoryKuser::getSearchIndexFieldValue($fieldName, $singleValue, $partnerId);
             }
         } else {
             $value = categoryKuser::getSearchIndexFieldValue($fieldName, $value, $partnerId);
         }
     }
     return array($field, $crit->getComparison(), $value);
 }