public function updateEmotion(PwEmotionDm $dm) { $resource = $dm->beforeUpdate(); if ($resource instanceof PwError) { return $resource; } return $this->_getDao()->updateEmotion($dm->emotionId, $dm->getData()); }
public function dousedAction() { $emotionId = (int) $this->getInput('emotionid', 'get'); $used = (int) $this->getInput('used', 'get'); if ($emotionId < 1) { $this->showError('ADMIN:fail'); } $used = $used > 0 ? 1 : 0; Wind::import('SRV:emotion.dm.PwEmotionDm'); $dm = new PwEmotionDm($emotionId); $dm->setIsused($used); $resource = $this->_getEmotionDs()->updateEmotion($dm); if ($resource instanceof PwError) { $this->showError($resource->getError()); } $this->showMessage("MEDAL:success"); }