Beispiel #1
0
 /**
  * Set the model to be used by the bridge.
  *
  * This method exist to allow overruling in implementation classes
  *
  * @param \MUtil_Model_ModelAbstract $model
  * @return \MUtil_Model_Bridge_TableBridge
  */
 public function setModel(\MUtil_Model_ModelAbstract $model)
 {
     $this->sortAscParam = $model->getSortParamAsc();
     $this->sortDescParam = $model->getSortParamDesc();
     if ($sort = $model->getSort()) {
         $this->setSort($sort);
     }
     return parent::setModel($model);
 }
 /**
  * Use this when overruling processFilterAndSort()
  *
  * Overrule to implement snippet specific filtering and sorting.
  *
  * @param \MUtil_Model_ModelAbstract $model
  */
 protected function processSortOnly(\MUtil_Model_ModelAbstract $model)
 {
     if ($this->request) {
         if ($sort = $this->request->getParam($model->getSortParamAsc())) {
             $model->addSort(array($sort => SORT_ASC));
         } elseif ($sort = $this->request->getParam($model->getSortParamDesc())) {
             $model->addSort(array($sort => SORT_DESC));
         }
     }
 }