PHP 클래스 Flarum\Core\Repository\PostRepository

파일 보기 프로젝트 열기: flarum/core 1 사용 예제들

공개 메소드들

메소드 설명
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