PHP Класс Flarum\Core\Repository\PostRepository

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
filterVisibleIds ( array $ids, User $actor ) : array Filter a list of post IDs to only include posts that are visible to a certain user.
findByIds ( array $ids, User $actor = null ) : Illuminate\Database\Eloquent\Collection Find posts by their IDs, optionally making sure they are visible to a certain user.
findOrFail ( integer $id, User $actor = null ) : Post Find a post by ID, optionally making sure it is visible to a certain user, or throw an exception.
findWhere ( array $where = [], User $actor = null, array $sort = [], integer $count = null, integer $start ) : Illuminate\Database\Eloquent\Collection Find posts that match certain conditions, optionally making sure they are visible to a certain user, and/or using other criteria.
getIndexForNumber ( integer $discussionId, integer $number, User $actor = null ) : integer 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.
query ( ) : Builder Get a new query builder for the posts table.

Защищенные методы

Метод Описание
getDiscussionsForPosts ( $postIds, User $actor ) : mixed
queryIds ( array $ids, User $actor = null ) : mixed

Описание методов

filterVisibleIds() публичный Метод

Filter a list of post IDs to only include posts that are visible to a certain user.
public filterVisibleIds ( array $ids, User $actor ) : array
$ids array
$actor Flarum\Core\User
Результат array

findByIds() публичный Метод

Find posts by their IDs, optionally making sure they are visible to a certain user.
public findByIds ( array $ids, User $actor = null ) : Illuminate\Database\Eloquent\Collection
$ids array
$actor Flarum\Core\User
Результат Illuminate\Database\Eloquent\Collection

findOrFail() публичный Метод

Find a post by ID, optionally making sure it is visible to a certain user, or throw an exception.
public findOrFail ( integer $id, User $actor = null ) : Post
$id integer
$actor Flarum\Core\User
Результат Flarum\Core\Post

findWhere() публичный Метод

Find posts that match certain conditions, optionally making sure they are visible to a certain user, and/or using other criteria.
public findWhere ( array $where = [], User $actor = null, array $sort = [], integer $count = null, integer $start ) : Illuminate\Database\Eloquent\Collection
$where array
$actor Flarum\Core\User
$sort array
$count integer
$start integer
Результат Illuminate\Database\Eloquent\Collection

getDiscussionsForPosts() защищенный Метод

protected getDiscussionsForPosts ( $postIds, User $actor ) : mixed
$postIds
$actor Flarum\Core\User
Результат mixed

getIndexForNumber() публичный Метод

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.
public getIndexForNumber ( integer $discussionId, integer $number, User $actor = null ) : integer
$discussionId integer
$number integer
$actor Flarum\Core\User
Результат integer

query() публичный Метод

Get a new query builder for the posts table.
public query ( ) : Builder
Результат Illuminate\Database\Eloquent\Builder

queryIds() защищенный Метод

protected queryIds ( array $ids, User $actor = null ) : mixed
$ids array
$actor Flarum\Core\User
Результат mixed