class PostRepository
Methods
findOrFail(int $id, User|null $actor = null)
Find a post by ID, optionally making sure it is visible to a certain user, or throw an exception.
array
filterVisibleIds(array $ids, User $actor)
Filter a list of post IDs to only include posts that are visible to a certain user.
int
getIndexForNumber(int $discussionId, int $number, User|null $actor = null)
Get the position within a discussion where a post with a certain number is. If the post with that number does not exist, the index of the closest post to it will be returned.
Details
at
line 47
Post
findOrFail(int $id, User|null $actor = null)
Find a post by ID, optionally making sure it is visible to a certain user, or throw an exception.
at
line 56
Collection
findWhere(array $where = [], User|null $actor = null, array $sort = [], int|null $count = null, int $start = 0)
Find posts that match certain conditions, optionally making sure they are visible to a certain user, and/or using other criteria.
at
line 76
array
filterVisibleIds(array $ids, User $actor)
Filter a list of post IDs to only include posts that are visible to a certain user.