本文整理汇总了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));
}
}