/** * 更新文章 * @see \article\dao\interfaces\IArtoneDao::update() */ public function update($data, $id) { //开启事务 $this->beginTransaction(); $result = $this->getModelDao()->update($data, $id); if ($result != false) { if ($this->dataDao->update($data, $id)) { $this->commit(); return true; } else { $this->rollback(); return false; } } else { //操作失败,回滚 $this->rollback(); return false; } }
/** * @see \common\dao\interfaces\ICommonDao::update */ public function update($data, $id) { return $this->modelDao->update($data, $id); }