/** * @role update */ public function sort() { foreach ($this->request->get($this->request->get('target'), array()) as $position => $key) { $class = ShippingClass::getInstanceByID((int) $key); $class->position->set((int) $position); $class->save(); } return new JSONResponse(false, 'success'); }