예제 #1
0
 public function setRequest(Am_Request $request)
 {
     $this->completeRequest = $request;
     $arr = array();
     foreach ($request->toArray() as $k => $v) {
         if (strpos($k, $this->id . '_') === 0) {
             $k = substr($k, strlen($this->id) + 1);
             if (!strlen($k)) {
                 continue;
             }
             $arr[$k] = $v;
         }
     }
     $this->request = new Am_Request($arr);
     $sort = $this->request->get('sort');
     if (!empty($sort)) {
         $sort = explode(' ', $sort, 2);
         $this->getDataSource()->setOrder(filterId($sort[0]), !empty($sort[1]));
     }
 }