/** * (non-PHPdoc) * @see Backend_Controller_Crud::loaddataAction() */ public function loaddataAction() { $id = Request::post('id', 'int', false); if (!$id) { Response::jsonError($this->_lang->WRONG_REQUEST); } Response::jsonSuccess($this->_model->getItem($id, $this->_listFields)); }
/** * Create a new instance for the given model. * * @param Model $objModel The model to iterate over. */ public function __construct(Model $objModel) { $this->intPosition = 0; $this->objModel = $objModel; $objMetaModel = $this->objModel->getItem()->getMetaModel(); $arrKeys = array(); if ($objMetaModel->hasVariants()) { $arrKeys[] = 'varbase'; $arrKeys[] = 'vargroup'; } $this->arrKeys = array_merge($arrKeys, array_keys($objMetaModel->getAttributes())); }
/** * Load object data * @throws Exception */ protected function _loadData() { $data = $this->_model->getItem($this->_id); if (empty($data)) { throw new Exception('Cannot find object ' . $this->_name . ':' . $this->_id); } $this->_setRawData($data); }
/** * (non-PHPdoc) * @see Bgtask_Storage::get() */ public function get($pid) { return $this->_objectModel->getItem($pid); }