/** * do recursive update * * @param Felamimail_Model_Account $_account * @param Tinebase_Record_RecordSet $_folderResult */ protected function _updateRecursive(Felamimail_Model_Account $_account, Tinebase_Record_RecordSet $_folderResult) { foreach ($_folderResult as $folder) { if ($folder->has_children) { $this->update($_account, $folder->globalname, TRUE); } else { $this->_removeFromCache($_account, $folder->globalname); } $this->_backend->update($folder); } }
/** * do recursive update * * @param Felamimail_Model_Account $_account * @param Tinebase_Record_RecordSet $_folderResult */ protected function _updateRecursive(Felamimail_Model_Account $_account, Tinebase_Record_RecordSet $_folderResult) { foreach ($_folderResult as $folder) { if ($folder->has_children) { $this->update($_account, $folder->globalname, TRUE); } else { $this->_removeFromCache($_account, $folder->globalname); } if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' about to update folder ' . $folder->globalname); } $this->_backend->update($folder); } }
/** * update single folder * * @param Felamimail_Model_Folder $_folder * @return Felamimail_Model_Folder */ public function update(Felamimail_Model_Folder $_folder) { return $this->_backend->update($_folder); }
/** * testGetCountOfChanges (inbox folder cache should be updated here by _inspectGetServerEntries fn) * * @see 0006232: Emails get only synched, if the user is logged on with an browser */ public function testGetCountOfChanges() { $controller = $this->_getController($this->_getDevice(Syncroton_Model_Device::TYPE_IPHONE)); // set inbox timestamp a long time ago (15 mins) $inbox = $this->_emailTestClass->getFolder('INBOX'); $inbox->cache_timestamp = Tinebase_DateTime::now()->subMinute(15); $folderBackend = new Felamimail_Backend_Folder(); $folderBackend->update($inbox); $numberOfChanges = $controller->getCountOfChanges(Syncroton_Registry::getContentStateBackend(), new Syncroton_Model_Folder(array('id' => Tinebase_Record_Abstract::generateUID(), 'serverId' => $inbox->getId(), 'lastfiltertype' => Syncroton_Command_Sync::FILTER_NOTHING)), new Syncroton_Model_SyncState(array('lastsync' => Tinebase_DateTime::now()->subHour(1)))); $inbox = $this->_emailTestClass->getFolder('INBOX'); $this->assertEquals(1, $inbox->cache_timestamp->compare(Tinebase_DateTime::now()->subSecond(15)), 'inbox cache has not been updated: ' . print_r($inbox, TRUE)); }