Performance improvements when displaying local posts

This commit is contained in:
Michael 2024-04-17 19:16:47 +00:00
parent bae1f63424
commit c82a1ed467
16 changed files with 1101 additions and 28 deletions

View file

@ -379,6 +379,21 @@ class Post
return self::selectView('post-user-view', $selected, $condition, $params);
}
/**
* Select rows from the post-origin-view view
*
* @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
*
* @return boolean|object
* @throws \Exception
*/
public static function selectOrigin(array $selected = [], array $condition = [], array $params = [])
{
return self::selectView('post-origin-view', $selected, $condition, $params);
}
/**
* Select rows from the post-view view
*
@ -424,6 +439,21 @@ class Post
return self::selectView('post-thread-view', $selected, $condition, $params);
}
/**
* Select rows from the post-thread-origin-view view
*
* @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
*
* @return boolean|object
* @throws \Exception
*/
public static function selectOriginThread(array $selected = [], array $condition = [], array $params = [])
{
return self::selectView('post-thread-origin-view', $selected, $condition, $params);
}
/**
* Select rows from the given view for a given user
*
@ -513,6 +543,11 @@ class Post
return self::selectViewForUser('post-timeline-view', $uid, $selected, $condition, $params);
}
public static function selectLocalTimelineForUser(int $uid, array $selected = [], array $condition = [], array $params = [])
{
return self::selectViewForUser('post-timeline-origin-view', $uid, $selected, $condition, $params);
}
/**
* Select rows from the post-thread-user-view view for a given user
*