當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tinebase_Record_Abstract::convertId方法代碼示例

本文整理匯總了PHP中Tinebase_Record_Abstract::convertId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tinebase_Record_Abstract::convertId方法的具體用法?PHP Tinebase_Record_Abstract::convertId怎麽用?PHP Tinebase_Record_Abstract::convertId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tinebase_Record_Abstract的用法示例。


在下文中一共展示了Tinebase_Record_Abstract::convertId方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get

 /**
  * get by id
  * - results are cached
  *
  * @param string $_id the id of the peer
  * @return Voipmanager_Model_Snom_Location
  */
 public function get($_id)
 {
     $id = Tinebase_Record_Abstract::convertId($_id, $this->_modelName);
     if ($this->_cacheIdPrefix && $this->_cache) {
         $cacheId = $this->_cacheIdPrefix . $id;
         if ($this->_cache->test($id)) {
             $result = $this->_cache->load($id);
         } else {
             $result = $this->_backend->get($id);
             $this->_cache->save($result, $cacheId, array($this->_cacheIdPrefix), 5);
         }
     } else {
         $result = $this->_backend->get($id);
     }
     return $result;
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:23,代碼來源:Abstract.php

示例2: _getUpdates

 /**
  * get updates of human interest
  * 
  * @param  Calendar_Model_Event $_event
  * @param  Calendar_Model_Event $_oldEvent
  * @return array
  */
 protected function _getUpdates($_event, $_oldEvent)
 {
     // check event details
     $diff = $_event->diff($_oldEvent)->diff;
     $orderedUpdateFieldOfInterest = array('dtstart', 'dtend', 'rrule', 'summary', 'location', 'description', 'transp', 'priority', 'status', 'class', 'url', 'is_all_day_event', 'originator_tz');
     $updates = array();
     foreach ($orderedUpdateFieldOfInterest as $field) {
         if (isset($diff[$field]) || array_key_exists($field, $diff)) {
             $updates[$field] = $diff[$field];
         }
     }
     // rrule legacy
     if (isset($updates['rrule']) || array_key_exists('rrule', $updates)) {
         $updates['rrule'] = $_oldEvent->rrule;
     }
     // check for organizer update
     if (Tinebase_Record_Abstract::convertId($_event['organizer'], 'Addressbook_Model_Contact') != Tinebase_Record_Abstract::convertId($_oldEvent['organizer'], 'Addressbook_Model_Contact')) {
         $updates['organizer'] = $_event->resolveOrganizer();
     }
     // check attendee updates
     $attendeeMigration = Calendar_Model_Attender::getMigration($_oldEvent->attendee, $_event->attendee);
     foreach ($attendeeMigration['toUpdate'] as $attendee) {
         $oldAttendee = Calendar_Model_Attender::getAttendee($_oldEvent->attendee, $attendee);
         if ($attendee->status == $oldAttendee->status) {
             $attendeeMigration['toUpdate']->removeRecord($attendee);
         }
     }
     foreach ($attendeeMigration as $action => $migration) {
         Calendar_Model_Attender::resolveAttendee($migration, FALSE);
         if (!count($migration)) {
             unset($attendeeMigration[$action]);
         }
     }
     if (!empty($attendeeMigration)) {
         $updates['attendee'] = $attendeeMigration;
     }
     return $updates;
 }
開發者ID:hernot,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:45,代碼來源:EventNotifications.php

示例3: getMemberships

 /**
  * get group memberships of contact id
  * 
  * @param mixed $contactId
  * @return array
  */
 public function getMemberships($contactId)
 {
     $contactId = Tinebase_Record_Abstract::convertId($contactId, 'Addressbook_Model_Contact');
     $select = $this->_db->select()->from($this->_tablePrefix . $this->_foreignTables['members']['table'], 'list_id')->where($this->_db->quoteIdentifier('contact_id') . ' = ?', $contactId);
     $stmt = $this->_db->query($select);
     $rows = (array) $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
     $result = array();
     foreach ($rows as $membership) {
         $result[] = $membership['list_id'];
     }
     return $result;
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:18,代碼來源:List.php

示例4: delete

 /**
  * Deletes entries
  * 
  * @param string|integer|Tinebase_Record_Interface|array $_id
  * @return int The number of affected rows.
  */
 public function delete($_id)
 {
     if (empty($_id)) {
         if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) {
             Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' No records deleted.');
         }
         return 0;
     }
     $idArray = !is_array($_id) ? array(Tinebase_Record_Abstract::convertId($_id, $this->_modelName)) : $_id;
     $identifier = $this->_getRecordIdentifier();
     $where = array($this->_db->quoteInto($this->_db->quoteIdentifier($identifier) . ' IN (?)', $idArray));
     return $this->_db->delete($this->_tablePrefix . $this->_tableName, $where);
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:19,代碼來源:Abstract.php

示例5: _getRedirect

 /**
  * get redirects by sippeer_id
  * 
  * @param string|Voipmanager_Model_Asterisk_SipPeer $_sipPeer the sippeer id|object
  * @return Voipmanager_Model_Asterisk_Redirect
  * 
  * @throws Voipmanager_Exception_NotFound
  */
 protected function _getRedirect($_sipPeer)
 {
     $sipPeerId = Tinebase_Record_Abstract::convertId($_sipPeer, 'Voipmanager_Model_Asterisk_SipPeer');
     $filter = new Voipmanager_Model_Asterisk_RedirectFilter(array(array('field' => 'sippeer_id', 'operator' => 'equals', 'value' => $sipPeerId)));
     $redirects = Voipmanager_Controller_Asterisk_Redirect::getInstance()->search($filter);
     if (count($redirects) === 0) {
         throw new Voipmanager_Exception_NotFound();
     }
     return $redirects[0];
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:18,代碼來源:CallForward.php


注:本文中的Tinebase_Record_Abstract::convertId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。