コード例 #1
0
ファイル: DraftController.php プロジェクト: fanqimeng/4tweb
 /**
  * 添加草稿
  *
  * @return void
  */
 public function doAddAction()
 {
     list($title, $content) = $this->getInput(array('atc_title', 'atc_content'));
     if (!$title || !$content) {
         $this->showError('BBS:draft.content.empty');
     }
     if ($this->_getDraftDs()->countByUid($this->loginUser->uid) >= $this->maxNum) {
         $this->showError('BBS:draft.num.max');
     }
     $draftDm = new PwDraftDm();
     $draftDm->setTitle($title)->setContent($content)->setCreatedUserid($this->loginUser->uid)->setCreatedTime(PW::getTime());
     $this->_getDraftDs()->addDraft($draftDm);
     $this->showMessage('success');
 }