Use the uid for the owner cache
This commit is contained in:
@@ -213,10 +213,10 @@ class User
|
|||||||
* @return boolean|array
|
* @return boolean|array
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static function getOwnerDataById($uid, $check_valid = true)
|
public static function getOwnerDataById(int $uid, bool $check_valid = true)
|
||||||
{
|
{
|
||||||
if (!empty(self::$owner)) {
|
if (!empty(self::$owner[$uid])) {
|
||||||
return self::$owner;
|
return self::$owner[$uid];
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
|
$owner = DBA::selectFirst('owner-view', [], ['uid' => $uid]);
|
||||||
@@ -262,7 +262,7 @@ class User
|
|||||||
$owner = self::getOwnerDataById($uid, false);
|
$owner = self::getOwnerDataById($uid, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
self::$owner = $owner;
|
self::$owner[$uid] = $owner;
|
||||||
return $owner;
|
return $owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user