示例#1
0
文件: TempFiles.php 项目: valizr/MMA
 public function save(Default_Model_TempFiles $model)
 {
     $data = array('userId' => $model->getUserId(), 'fileName' => $model->getFileName(), 'type' => $model->getType(), 'fileType' => $model->getFileType(), 'fileSize' => $model->getFileSize());
     if (null === ($id = $model->getId())) {
         $data['created'] = new Zend_Db_Expr('NOW()');
         $id = $this->getDbTable()->insert($data);
     } else {
         $this->getDbTable()->update($data, array('id = ?' => $id));
     }
     return $id;
 }