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


PHP Gdn_Model::GetID方法代碼示例

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


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

示例1: GetID

 /**
  * Returns a single message object for the specified id or FALSE if not found.
  *
  * @param int The MessageID to filter to.
  */
 public function GetID($MessageID)
 {
     if (Gdn::Cache()->ActiveEnabled()) {
         return self::Messages($MessageID);
     } else {
         return parent::GetID($MessageID);
     }
 }
開發者ID:Raz0r,項目名稱:Garden,代碼行數:13,代碼來源:class.messagemodel.php

示例2: GetID

 /**
  * Get a particular activity record.
  *
  * @since 2.0.0
  * @access public
  * @param int $ActivityID Unique ID of activity item.
  * @return array|object A single SQL result.
  */
 public function GetID($ActivityID, $DataType = FALSE)
 {
     $Activity = parent::GetID($ActivityID, $DataType);
     if ($Activity) {
         $this->CalculateRow($Activity);
         $Activities = array($Activity);
         self::JoinUsers($Activities);
         $Activity = array_pop($Activities);
     }
     return $Activity;
 }
開發者ID:robhazkes,項目名稱:Garden,代碼行數:19,代碼來源:class.activitymodel.php

示例3: GetID

 public function GetID($ID, $DatasetType = DATASET_TYPE_OBJECT)
 {
     if (!$ID) {
         return FALSE;
     }
     // Check page cache, then memcached
     $User = $this->GetUserFromCache($ID, 'userid');
     // If not, query DB
     if ($User === Gdn_Cache::CACHEOP_FAILURE) {
         $User = parent::GetID($ID, DATASET_TYPE_ARRAY);
         if ($User) {
             // If success, build more data, then cache user
             $this->SetCalculatedFields($User);
             $this->UserCache($User);
         }
     }
     // Allow FALSE returns
     if ($User === FALSE || is_null($User)) {
         return FALSE;
     }
     if (is_array($User) && $DatasetType == DATASET_TYPE_OBJECT) {
         $User = (object) $User;
     }
     if (is_object($User) && $DatasetType == DATASET_TYPE_ARRAY) {
         $User = (array) $User;
     }
     $this->EventArguments['LoadedUser'] =& $User;
     $this->FireEvent('AfterGetID');
     return $User;
 }
開發者ID:statico,項目名稱:openshift-origin-vanillaforums,代碼行數:30,代碼來源:class.usermodel.php

示例4: GetID

   public function GetID($ID, $DatasetType = FALSE) {
      $User = parent::GetID($ID, $DatasetType);

      if ($User)
         $this->SetCalculatedFields($User);
      return $User;
   }
開發者ID:nerdgirl,項目名稱:Forums-ILoveBadTV,代碼行數:7,代碼來源:class.usermodel.php

示例5: GetID

 public function GetID($ID, $DatasetType = DATASET_TYPE_OBJECT)
 {
     if (!$ID) {
         return FALSE;
     }
     // Check page cache, then memcached
     $User = $this->GetUserFromCache($ID, 'userid');
     // If not, query DB
     if ($User === Gdn_Cache::CACHEOP_FAILURE) {
         $User = parent::GetID($ID, DATASET_TYPE_ARRAY);
         // We want to cache a non-existant user no-matter what.
         if (!$User) {
             $User = NULL;
         }
         $this->UserCache($User, $ID);
     } elseif (!$User) {
         return FALSE;
     }
     // Apply calculated fields
     $this->SetCalculatedFields($User);
     // Allow FALSE returns
     if ($User === FALSE || is_null($User)) {
         return FALSE;
     }
     if (is_array($User) && $DatasetType == DATASET_TYPE_OBJECT) {
         $User = (object) $User;
     }
     if (is_object($User) && $DatasetType == DATASET_TYPE_ARRAY) {
         $User = (array) $User;
     }
     $this->EventArguments['LoadedUser'] =& $User;
     $this->FireEvent('AfterGetID');
     return $User;
 }
開發者ID:edward-tsai,項目名稱:vanilla4china,代碼行數:34,代碼來源:class.usermodel.php

示例6: GetID

 /**
  * {@inheritDoc}
  * in addition; We CalculateRow on the record found (Add Attachments)
  * @see Gdn_Model::GetID
  */
 public function GetID($ID, $DatasetType = DATASET_TYPE_ARRAY, $Options = array())
 {
     $DatasetType = DATASET_TYPE_ARRAY;
     $Row = (array) parent::GetID($ID, $DatasetType, $Options);
     $this->CalculateRow($Row);
     return $Row;
 }
開發者ID:3marproof,項目名稱:vanilla,代碼行數:12,代碼來源:class.attachmentmodel.php


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