Exemple #1
0
 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);
 }
Exemple #2
0
 public function testSetMsgDb()
 {
     $this->assertTrue(true);
     $db1 = new MsgDb();
     $msg = new Msg();
     $msg->setMsgDb($db1);
     $db2 = $msg->getMsgDb();
     $this->assertEquals($db1, $db2);
 }