当前位置: 首页>>代码示例>>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;未经允许,请勿转载。