Example #1
0
 protected function _applyToCollection($collection, $value = null)
 {
     if ($rangeAndLabels = $this->_getRangeAndLabels()) {
         extract($rangeAndLabels);
         /* @var $text array */
         /* @var $from string */
         /* @var $to string */
         $isInside = false;
         $items = $this->_getItemsData();
         $values = array();
         foreach ($items as $item) {
             if ($item['value'] == $from) {
                 if ($item['value'] != $to) {
                     $isInside = true;
                 }
                 $values[] = $item['value'];
             } elseif ($item['value'] == $to) {
                 $isInside = false;
                 $values[] = $item['value'];
             } elseif ($isInside) {
                 $values[] = $item['value'];
             }
         }
         parent::_applyToCollection($collection, $values);
     }
     //$this->_getResource()->applyToCollection($collection, $this, $this->getMSelectedValues());
 }
 /**
  * @param Enterprise_Search_Model_Resource_Collection $collection
  * @param Mana_Filters_Model_Solr_Attribute $model
  * @return Mana_Filters_Resource_Solr_Attribute
  */
 public function countOnCollection($collection, $model)
 {
     $collection->setFacetCondition($model->getFilterField());
     return $collection;
 }