/** * save folderstate (aka: remember that we have sent the folder to the client) * * @param string $_class the class from the xml * @param string $_folderId the Tine 2.0 id of the folder */ protected function _addFolderState($_class, $_folderId) { $folderState = new ActiveSync_Model_FolderState(array('device_id' => $this->_device->getId(), 'class' => $_class, 'folderid' => $_folderId, 'creation_time' => $this->_syncTimeStamp)); /** * if the entry got added earlier, and there was an error, the entry gets added again * @todo it's better to wrap the whole process into a transation */ try { $this->_folderStateBackend->create($folderState); } catch (Zend_Db_Statement_Exception $e) { $this->_deleteFolderState($_class, $_folderId); $this->_folderStateBackend->create($folderState); } }