本文整理匯總了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;
}
示例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;
}
}
示例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;
}
}
示例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));
}
}