/** * update existing entry * * @param unknown_type $_collectionId * @param string $_id * @param SimpleXMLElement $_data * @return Tinebase_Record_Abstract */ public function updateEntry($_folderId, $_serverId, SimpleXMLElement $_entry) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . " update CollectionId: {$_folderId} Id: {$_serverId}"); } $oldEntry = $this->_contentController->get($_serverId); $entry = $this->toTineModel($_entry, $oldEntry); $entry->last_modified_time = new Tinebase_DateTime($this->_syncTimeStamp); $entry = $this->_contentController->update($entry); return $entry->getId(); }
/** * (non-PHPdoc) * @see Syncroton_Data_IData::updateEntry() */ public function updateEntry($folderId, $serverId, Syncroton_Model_IEntry $entry) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . " update CollectionId: {$folderId} Id: {$serverId}"); } try { $oldEntry = $this->_contentController->get($serverId); } catch (Tinebase_Exception_NotFound $tenf) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . $tenf); } throw new Syncroton_Exception_NotFound($tenf->getMessage()); } $updatedEmtry = $this->toTineModel($entry, $oldEntry); // @FIXME: this skips concurrency handling $updatedEmtry->last_modified_time = new Tinebase_DateTime($this->_syncTimeStamp); try { $updatedEmtry = $this->_contentController->update($updatedEmtry); } catch (Tinebase_Exception_AccessDenied $tead) { throw new Syncroton_Exception_AccessDenied(); } return $updatedEmtry->getId(); }
/** * (non-PHPdoc) * @see Tinebase_Controller_Record_Abstract::get() */ public function get($_id, $_containerId = NULL) { $result = new Tinebase_Record_RecordSet('Addressbook_Model_List', array(parent::get($_id, $_containerId))); $this->_removeHiddenListMembers($result); return $result->getFirstRecord(); }
/** * fetch one tag identified by tagid * * @param int $_tagId * @return Tinebase_Model_FullTag */ public function get($_tagId) { $fullTag = parent::get($_tagId); $fullTag->rights = Tinebase_Tags::getInstance()->getRights($_tagId); $fullTag->contexts = Tinebase_Tags::getInstance()->getContexts($_tagId); return $fullTag; }
/** * (non-PHPdoc) * @see Tinebase_Controller_Record_Abstract::get() */ public function get($_id, $_containerId = NULL) { if (!$this->_checkACLContainer($this->_backend->getNodeContainer($_id), 'get')) { throw new Tinebase_Exception_AccessDenied('No permission to get node'); } $record = parent::get($_id); if ($record) { $record->notes = Tinebase_Notes::getInstance()->getNotesOfRecord('Tinebase_Model_Tree_Node', $record->getId()); } return $record; }
/** * get by id * * @param string $_id * @return Tinebase_Record_RecordSet */ public function get($_id) { $sharedContracts = Tinebase_Container::getInstance()->getContainerByName('Sales', 'Shared Contracts', 'shared'); return parent::get($_id, $sharedContracts->getId()); }
/** * get by id * * @param string $_id * @param int $_containerId * @return Felamimail_Model_Account */ public function get($_id, $_containerId = NULL) { $record = parent::get($_id, $_containerId); if ($record->type == Felamimail_Model_Account::TYPE_SYSTEM) { $this->_addSystemAccountConfigValues($record); } return $record; }
/** * get by id * * @param string $_id * @param int $_containerId * @return Tinebase_Record_Interface * @throws Tinebase_Exception_AccessDenied */ public function get($_id, $_containerId = NULL) { $record = parent::get($_id, $_containerId); $this->_doPrivateCleanup($record); return $record; }
/** * get by id * * @param string $_id * @param int $_containerId * @return Expressomail_Model_Account */ public function get($_id, $_containerId = NULL) { Tinebase_Core::setupCache(); $cache = Tinebase_Core::getCache(); $cacheId = Tinebase_Helper::arrayHash(array(Tinebase_Core::getUser()->accountId, $_id)); $record = $cache->load($cacheId); if ($record === FALSE) { $record = parent::get($_id, $_containerId); if ($record->user_id !== Tinebase_Core::getUser()->accountId) { $record = new Expressomail_Model_Account(); } if ($record->type == Expressomail_Model_Account::TYPE_SYSTEM) { $this->_addSystemAccountConfigValues($record); } $cache->save($record, $cacheId, array('expressomailAccount')); } return $record; }
/** * get by id * * @param string $_id * @param int $_containerId * @return Expressomail_Model_Account */ public function get($_id, $_containerId = NULL) { Tinebase_Core::setupCache(); $cache = Tinebase_Core::getCache(); $cacheId = $this->_createExpressomailModelAccountCacheId($_id); $record = $cache->load($cacheId); if ($record === FALSE) { $record = parent::get($_id, $_containerId); if ($record->user_id !== Tinebase_Core::getUser()->accountId) { $record = new Expressomail_Model_Account(); } if ($record->type == Expressomail_Model_Account::TYPE_SYSTEM) { $this->_addSystemAccountConfigValues($record); } if ($this->_checkSharedSeenSupport($record)) { $record->shared_seen_support = TRUE; $record->shared_seen = $this->_getSharedSeenValue($record); } if ($this->_resolveCustomFields && $record->has('customfields')) { Tinebase_CustomField::getInstance()->resolveRecordCustomFields($record); } $cache->save($record, $cacheId, array('expressomailAccount')); } return $record; }
/** * (non-PHPdoc) * @see Tinebase_Controller_Record_Abstract::get() */ public function get($_id, $_containerId = NULL, $_getRelatedData = TRUE, $_getDeleted = FALSE) { if (preg_match('/^fakeid/', $_id)) { // get base event when trying to fetch a non-persistent recur instance return $this->getRecurBaseEvent(new Calendar_Model_Event(array('uid' => substr(str_replace('fakeid', '', $_id), 0, 40))), TRUE); } else { return parent::get($_id, $_containerId, $_getRelatedData, $_getDeleted); } }