public function commitJson() { $operation = Ajde::app()->getRequest()->getParam('operation'); $crudId = Ajde::app()->getRequest()->getParam('crudId'); $id = Ajde::app()->getRequest()->getPostParam('id', false); Ajde_Model::registerAll(); switch ($operation) { case 'delete': return $this->delete($crudId, $id); break; case 'save': return $this->save($crudId, $id); break; case 'sort': return $this->sort($crudId, $id); break; default: return array('operation' => $operation, 'success' => false); break; } }
/** * * @param string $entity * @return Ajde_Model */ protected function _getEntityModel($entityName) { Ajde_Model::registerAll(); $entityModelName = ucfirst((string) $entityName) . 'Model'; return new $entityModelName(); }