Exemplo n.º 1
0
 public function save(Default_Model_Messages $value)
 {
     $data = array('idUserFrom' => $value->getIdUserFrom(), 'idUserTo' => $value->getIdUserTo(), 'subject' => $value->getSubject(), 'message' => $value->getMessage(), 'deletedTo' => $value->getDeletedTo() != null ? $value->getDeletedTo() : 0, 'deletedFrom' => $value->getDeletedFrom() != null ? $value->getDeletedFrom() : 0, 'read' => $value->getRead() != null ? $value->getRead() : 0);
     if (null === ($id = $value->getId())) {
         $data['created'] = new Zend_Db_Expr('NOW()');
         $id = $this->getDbTable()->insert($data);
     }
     return $id;
 }