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


PHP Core_Model_Item_Abstract::getPhotoUrl方法代碼示例

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


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

示例1: getPhotoUrl

 public function getPhotoUrl($type = null)
 {
     if ($this->photo_id) {
         return parent::getPhotoUrl($type);
     } else {
         return 'application/modules/Ynadvsearch/externals/images/icon-' . $this->type . '.png';
     }
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:8,代碼來源:Contenttype.php

示例2: getPhotoUrl

 public function getPhotoUrl($type = null)
 {
     $imgUrl = parent::getPhotoUrl($type);
     if ($imgUrl) {
         return $imgUrl;
     }
     $type = $type ? str_replace('.', '_', $type) : 'thumb_main';
     $view = Zend_Registry::get("Zend_View");
     return $view->layout()->staticBaseUrl . "application/modules/Advgroup/externals/images/nophoto_group_{$type}.png";
 }
開發者ID:hoalangoc,項目名稱:ftf,代碼行數:10,代碼來源:Group.php

示例3: addNotification

 /**
  * Add a notification
  *
  * @param User_Model_User $user The user to receive the notification
  * @param Core_Model_Item_Abstract $subject The item responsible for causing the notification
  * @param Core_Model_Item_Abstract $object Bleh
  * @param string $type
  * @param array $params
  * @return Activity_Model_Notification
  */
 public function addNotification(User_Model_User $user, Core_Model_Item_Abstract $subject, Core_Model_Item_Abstract $object, $type, array $params = null)
 {
     // We may want to check later if a request exists of the same type already
     $row = $this->createRow();
     $row->user_id = $user->getIdentity();
     $row->subject_type = $subject->getType();
     $row->subject_id = $subject->getIdentity();
     $row->object_type = $object->getType();
     $row->object_id = $object->getIdentity();
     $row->type = $type;
     $row->params = $params;
     $row->date = date('Y-m-d H:i:s');
     $row->save();
     // Try to add row to caching
     if (Zend_Registry::isRegistered('Zend_Cache')) {
         $cache = Zend_Registry::get('Zend_Cache');
         $id = __CLASS__ . '_new_' . $user->getIdentity();
         $cache->save(true, $id);
     }
     // Try to send an email
     $notificationSettingsTable = Engine_Api::_()->getDbtable('notificationSettings', 'activity');
     if ($notificationSettingsTable->checkEnabledNotification($user, $type) && !empty($user->email)) {
         // Main params
         $defaultParams = array('host' => $_SERVER['HTTP_HOST'], 'email' => $user->email, 'date' => time(), 'recipient_title' => $user->getTitle(), 'recipient_link' => $user->getHref(), 'recipient_photo' => $user->getPhotoUrl('thumb.icon'), 'sender_title' => $subject->getTitle(), 'sender_link' => $subject->getHref(), 'sender_photo' => $subject->getPhotoUrl('thumb.icon'), 'object_title' => $object->getTitle(), 'object_link' => $object->getHref(), 'object_photo' => $object->getPhotoUrl('thumb.icon'), 'object_description' => $object->getDescription());
         // Extra params
         try {
             $objectParent = $object->getParent();
             if ($objectParent && !$objectParent->isSelf($object)) {
                 $defaultParams['object_parent_title'] = $objectParent->getTitle();
                 $defaultParams['object_parent_link'] = $objectParent->getHref();
                 $defaultParams['object_parent_photo'] = $objectParent->getPhotoUrl('thumb.icon');
                 $defaultParams['object_parent_description'] = $objectParent->getDescription();
             }
         } catch (Exception $e) {
         }
         try {
             $objectOwner = $object->getParent();
             if ($objectOwner && !$objectOwner->isSelf($object)) {
                 $defaultParams['object_owner_title'] = $objectOwner->getTitle();
                 $defaultParams['object_owner_link'] = $objectOwner->getHref();
                 $defaultParams['object_owner_photo'] = $objectOwner->getPhotoUrl('thumb.icon');
                 $defaultParams['object_owner_description'] = $objectOwner->getDescription();
             }
         } catch (Exception $e) {
         }
         // Send
         try {
             Engine_Api::_()->getApi('mail', 'core')->sendSystem($user, 'notify_' . $type, array_merge($defaultParams, (array) $params));
         } catch (Exception $e) {
             // Silence exception
         }
     }
     return $row;
 }
開發者ID:robeendey,項目名稱:ce,代碼行數:64,代碼來源:Notifications.php

示例4: getPhotoUrl

 public function getPhotoUrl($type = null)
 {
     if (!empty($this->photo_url)) {
         $photo_urls = $this->photo_url;
         if (isset($photo_urls[$type])) {
             return $photo_urls[$type];
         }
     }
     return parent::getPhotoUrl($type);
 }
開發者ID:HiLeo1610,項目名稱:tumlumsach,代碼行數:10,代碼來源:User.php


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