示例#1
0
文件: MsgDb.php 项目: thefox/phpchat
 public function msgAdd(Msg $msg)
 {
     #print __CLASS__.'->'.__FUNCTION__.''."\n";
     #print __CLASS__.'->'.__FUNCTION__.': '.$msg->getId()."\n";
     $filePath = $msg->getFilePath();
     if ($this->getDatadirBasePath() && !$filePath) {
         $filePath = $this->getDatadirBasePath() . '/msg_' . $msg->getId() . '.yml';
     }
     $msg->setFilePath($filePath);
     $msg->setDatadirBasePath($this->getDatadirBasePath());
     $msg->setMsgDb($this);
     $this->msgs[$msg->getId()] = $msg;
     $this->setDataChanged(true);
 }