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


PHP XenForo_Model::getModelFromCache方法代碼示例

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


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

示例1: getDescription

 public function getDescription(XenForo_Model $model)
 {
     $resource = $this->_resourceDw->getMergedData();
     $resource = $model->getModelFromCache('XenResource_Model_Resource')->prepareResource($resource, null, $this->getViewingUser());
     $resource = $model->getModelFromCache('XenResource_Model_Resource')->prepareResourceCustomFields($resource, array(), $this->getViewingUser());
     $params = array('resource' => $resource);
     if ($resource['user_id'] == $this->getViewingUserId()) {
         return $this->_getSimulationTemplate('bdsocialshare_description_xenresource_resource', $params);
     } else {
         return $this->_getSimulationTemplate('bdsocialshare_description_xenresource_resource_aut', $params);
     }
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:12,代碼來源:Resource.php

示例2: getUserText

 public function getUserText(XenForo_Model $model)
 {
     $params = array();
     $params['trophyId'] = $this->_trophyId;
     $params['trophyPhrase'] = $this->_getPhrase($model->getModelFromCache('XenForo_Model_Trophy')->getTrophyTitlePhraseName($this->_trophyId));
     return $this->_getSimulationTemplate('bdsocialshare_user_text_i_am_awarded_trophy_x', $params);
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:7,代碼來源:Trophy.php

示例3: _getAttachment

 protected function _getAttachment(XenForo_Model $model)
 {
     if ($this->_attachment === null) {
         $this->_attachment = $model->getModelFromCache('XenForo_Model_Attachment')->getAttachmentById($this->_mediaDw->get('attachment_id'));
     }
     return $this->_attachment;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:7,代碼來源:Media.php

示例4: _getVideoData

 protected function _getVideoData(XenForo_Model $model)
 {
     if ($this->_videoData === null) {
         $this->_videoData = $model->getModelFromCache('sonnb_XenGallery_Model_VideoData')->getDataByDataId($this->_videoDw->get('content_data_id'));
     }
     return $this->_videoData;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:7,代碼來源:Video.php

示例5: _getPhotoData

 protected function _getPhotoData(XenForo_Model $model)
 {
     if ($this->_photoData === null) {
         $dataId = $this->_photoDw->get('photo_data_id');
         if (empty($dataId)) {
             // sonnb - XenGallery v2.0.0
             $dataId = $this->_photoDw->get('content_data_id');
         }
         $this->_photoData = $model->getModelFromCache('sonnb_XenGallery_Model_PhotoData')->getDataByDataId($dataId);
     }
     return $this->_photoData;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:12,代碼來源:Photo.php

示例6: getImage

 public function getImage(XenForo_Model $model)
 {
     $item = $this->_itemDw->getMergedData();
     if ($item['attach_count'] > 0) {
         if ($this->_image === false) {
             $item = $model->getModelFromCache('NFLJ_Showcase_Model_Item')->getAndMergeAttachmentsIntoItem($item);
             if (!empty($item['cover_image'])) {
                 $this->_image = XenForo_Link::convertUriToAbsoluteUri($item['cover_image']['thumbnailUrl'], true);
             } else {
                 $this->_image = '';
             }
         }
         if (!empty($this->_image)) {
             return $this->_image;
         }
     }
     return parent::getImage($model);
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:18,代碼來源:Item.php

示例7: notifyTaggedUsers3

 public function notifyTaggedUsers3($contentType, $contentId, $contentUserId, $contentUserName, $alertAction, array $taggedUsers, array $noAlertUserIds = array(), array $noEmailUserIds = array(), XenForo_Model $someRandomModel = null, array $options = array())
 {
     $options = array_merge(array(self::OPTION_MAX_TAGGED_USERS => bdTagMe_Option::get('max')), $options);
     if ($someRandomModel != null) {
         /* @var $userModel XenForo_Model_User */
         $userModel = $someRandomModel->getModelFromCache('XenForo_Model_User');
     } else {
         /* @var $userModel XenForo_Model_User */
         $userModel = XenForo_Model::create('XenForo_Model_User');
     }
     $neededUserIds = array();
     $taggableUserGroups = $this->getTaggableUserGroups();
     foreach ($taggedUsers as $taggedUserId => $taggedUserName) {
         if (is_numeric($taggedUserId)) {
             $neededUserIds[] = $taggedUserId;
         } else {
             if (strpos($taggedUserId, 'ug_') === 0) {
                 $userGroupId = substr($taggedUserId, 3);
                 if (isset($taggableUserGroups[$userGroupId])) {
                     $neededUserIds += array_keys($taggableUserGroups[$userGroupId]['userIds']);
                 }
             }
         }
     }
     if (!empty($neededUserIds)) {
         if ($options[self::OPTION_MAX_TAGGED_USERS] > 0) {
             // there are limit of maximum tagged users
             $userIds = array_slice($neededUserIds, 0, $options[self::OPTION_MAX_TAGGED_USERS]);
         } else {
             $userIds = $neededUserIds;
         }
     } else {
         $userIds = array();
     }
     if (count($userIds) > self::USERS_PER_BATCH) {
         $deferredUserIds = array_slice($userIds, self::USERS_PER_BATCH);
         $userIds = array_slice($userIds, 0, self::USERS_PER_BATCH);
         XenForo_Application::defer('bdTagMe_Deferred_NotifyUserIds', array($contentType, $contentId, $contentUserId, $contentUserName, $alertAction, $deferredUserIds, $noAlertUserIds, $noEmailUserIds, $options));
     }
     return $this->notifyUserIds($contentType, $contentId, $contentUserId, $contentUserName, $alertAction, $userIds, $noAlertUserIds, $noEmailUserIds, $userModel, $options);
 }
開發者ID:maitandat1507,項目名稱:bdTagMe,代碼行數:41,代碼來源:Engine.php

示例8: _getImageForAttachment

 protected function _getImageForAttachment($attachment, XenForo_Model $model)
 {
     // try to use full size link if possible
     $image = XenForo_Link::buildPublicLink('attachments', $attachment);
     if (Zend_URi::check($image) and substr($image, -1) !== '/') {
         $filename = basename($image);
         $ext = XenForo_Helper_File::getFileExtension($filename);
         if (in_array($ext, array('gif', 'jpg', 'jpeg', 'png'), true)) {
             return $image;
         }
     }
     // fallback to thumbnail
     $image = $model->getModelFromCache('XenForo_Model_Attachment')->getAttachmentThumbnailUrl($attachment);
     $image = XenForo_Link::convertUriToAbsoluteUri($image, true);
     return $image;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:16,代碼來源:Abstract.php

示例9: _getFirstPost

 protected function _getFirstPost(XenForo_Model $model)
 {
     if ($this->_firstPost === null) {
         $thread = $this->_postDw->getDiscussionData();
         if (!empty($thread['first_post_id'])) {
             $this->_firstPost = $model->getModelFromCache('XenForo_Model_Post')->getPostById($thread['first_post_id']);
         }
     }
     return $this->_firstPost;
 }
開發者ID:Sywooch,項目名稱:forums,代碼行數:10,代碼來源:Post.php


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