예제 #1
0
 /**
  * 增加一个附件
  *
  * @param PwThreadAttachDm $dm
  * @return bool|PwError
  */
 public function addAttach(PwThreadAttachDm $dm)
 {
     if (($result = $dm->beforeAdd()) !== true) {
         return $result;
     }
     if (($result = $this->_getAttach()->addAttach($dm)) instanceof PwError) {
         return $result;
     }
     $dm->setAid($result);
     $this->_getDao()->addAttach($dm->getData());
     return $result;
 }