public function save(CalemVersion $version) { try { $this->initDbo(); $row = $this->dbo->fetchById(VERSION_ID); $this->dbo->setChangeBulk(array('vid' => $version->getVid(), 'note' => $version->getNote(), 'props' => $version->getEncodedProps())); $this->dbo->setIdForUpdate(VERSION_ID); $this->dbo->update(); } catch (CalemDboDataNotFoundException $fe) { $this->dbo->setChangeBulk(array('id' => VERSION_ID, 'vid' => $version->getVid(), 'note' => $version->getNote(), 'props' => $version->getEncodedProps())); $this->dbo->insert(); } }