public function addAnd($p1, $p2 = null, $p3 = null) { if (is_null($p3)) { return parent::addAnd($p1, $p2, $p3); } // addAnd(column, value, comparison) $nc = new SphinxCriterion('SphinxEntryDistributionCriteria', $this, $p1, $p2, $p3); $oc = $this->getCriterion($p1); if (!is_null($oc)) { // no need to add again if ($oc->getValue() != $p2 || $oc->getComparison() != $p3) { $oc->addAnd($nc); } return $this; } return $this->add($nc); }