public function updateCategory(PwEmotionCategoryDm $dm) { $resource = $dm->beforeUpdate(); if ($resource instanceof PwError) { return $resource; } return $this->_getDao()->updateCategory($dm->categoryId, $dm->getData()); }
public function doaddAction() { Wind::import('SRV:emotion.dm.PwEmotionCategoryDm'); $dm = new PwEmotionCategoryDm(); $dm->setCategoryMame($this->getInput('catname', 'post'))->setEmotionFolder($this->getInput('folder', 'post'))->setEmotionApps(array('bbs'))->setOrderId((int) $this->getInput('orderid', 'post')); $resource = $this->_getEmotionCategoryDs()->addCategory($dm); if ($resource instanceof PwError) { $this->showError($resource->getError()); } $this->showMessage("MEDAL:success"); }