Ejemplo n.º 1
0
 /**
  * Add sorter to collection
  * @param \ToolsBundle\Model\Request $request
  * @return CurrencyList
  */
 public function sortData(Request $request)
 {
     $sort = $request->get('sort');
     $sortOrder = $request->get('sortOrder');
     if ($sort) {
         $this->_currencyCollection->sort(Sorter::factory($sort), $sortOrder);
     }
     return $this;
 }
Ejemplo n.º 2
0
 public function sort(Sorter $sorter, $dir = Sorter::SORT_DIRECTION_ASCENDING)
 {
     $sorter->setDirection($dir);
     usort($this->_items, array($sorter, $sorter->getCallback()));
 }