/** * 添加一条回收站记录(帖子) * * @param PwTopicRecycleDm $dm * @return bool */ public function add(PwTopicRecycleDm $dm) { if (($result = $dm->beforeAdd()) !== true) { return $result; } return $this->_getDao()->add($dm->getData()); }
private function deleteThread($topic) { $tid = $topic['tid']; $fid = $topic['fid']; $subject = $topic['subject']; $created_userid = $topic['created_userid']; $dm = new PwTopicRecycleDm(); $dm->setTid($tid)->setFid($fid)->setOperateTime(time())->setOperateUsername('system')->setReason('长期断种'); Wekit::load('recycle.PwTopicRecycle')->add($dm); $dm = new PwTopicDm($tid); $dm->setDisabled(2)->setTopped(0)->setDigest(0); Wekit::load('forum.PwThread')->updateThread($dm); $api = WindidApi::api('message'); $api->send($created_userid, '您的种子 ' . $subject . ' 因长期断种已被系统自动移入回收站,如有异议请尽快联系管理员,管理员将根据相关规定决定恢复或彻底删除。', 1); }
public function gleanData($value) { $dm = new PwTopicRecycleDm(); $dm->setTid($value['tid'])->setFid($value['fid'])->setOperateTime(Pw::getTime())->setOperateUsername($this->srv->user->username)->setReason($this->srv->reason); $this->record[] = $dm; }