API: (hopefully) improves speed of the public timeline

This commit is contained in:
Michael 2021-06-12 15:19:56 +00:00
parent cd8ce7eada
commit 24cc82f396
6 changed files with 124 additions and 11 deletions

View file

@ -342,13 +342,14 @@ class Post
* @param array $selected Array of selected fields, empty for all
* @param array $condition Array of fields for condition
* @param array $params Array of several parameters
* @param bool $user_mode true = post-user-view, false = post-view
*
* @return boolean|object
* @throws \Exception
*/
public static function selectForUser($uid, array $selected = [], array $condition = [], $params = [])
public static function selectForUser($uid, array $selected = [], array $condition = [], $params = [], bool $user_mode = true)
{
return self::selectViewForUser('post-user-view', $uid, $selected, $condition, $params);
return self::selectViewForUser($user_mode ? 'post-user-view' : 'post-view', $uid, $selected, $condition, $params);
}
/**