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


PHP SimpleORMap::find方法代碼示例

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


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

示例1: find

 /**
  * Returns the study area with the specified ID.
  */
 static function find($id)
 {
     $result = NULL;
     if ($id === self::ROOT) {
         $result = self::getRootArea();
     } else {
         $result = parent::find($id);
     }
     return $result;
 }
開發者ID:ratbird,項目名稱:hope,代碼行數:13,代碼來源:StudipStudyArea.class.php

示例2: find

 public static function find($user_id)
 {
     $user = parent::find(__CLASS__, $user_id);
     if (class_exists($user['contact_type'])) {
         $new_user = new $user['contact_type']();
         $new_user->setData($user->getData());
         return $new_user;
     } else {
         return $user;
     }
 }
開發者ID:noackorama,項目名稱:blubberforum,代碼行數:11,代碼來源:BlubberExternalContact.class.php

示例3: find

 /**
  * Finds a user by it's ID, but returns a class BlubberExternalContact or
  * an object of the class contact_type. If such a class exists, this means
  * that another plugin wants to handle the contact.
  * @param string $user_id
  * @return BlubberContact-object
  */
 public static function find($user_id)
 {
     $user = parent::find($user_id);
     if (class_exists($user['contact_type'])) {
         $new_user = new $user['contact_type']();
         $new_user->setData($user->toArray());
         $new_user->setNew(false);
         return $new_user;
     } else {
         return $user;
     }
 }
開發者ID:ratbird,項目名稱:hope,代碼行數:19,代碼來源:BlubberExternalContact.class.php

示例4: find

 /**
  * Find a User_Visibility_Setting by an id or an identifier and a user
  * 
  * @param type $id
  */
 public static function find($id = null, $userid = null)
 {
     // If we have no id or we have a real int id use standard construction
     if (!$id || is_int($id)) {
         parent::find($id);
     } else {
         // Rewrite user if nessecary
         $userid = $userid ?: $GLOBALS['user']->id;
         // Return the first (and only) matching visibility setting
         return self::findOneBySQL('user_id = ? AND identifier = ? LIMIT 1', array($userid, $id));
     }
 }
開發者ID:ratbird,項目名稱:hope,代碼行數:17,代碼來源:User_Visibility_Settings.php


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