PHP Class Flarum\Core\Repository\GroupRepository

Show file Open project: flarum/core Class Usage Examples

Public Methods

Method Description
findOrFail ( integer $id, User $actor = null ) : Group Find a user by ID, optionally making sure it is visible to a certain user, or throw an exception.
query ( ) : Builder Get a new query builder for the groups table.

Protected Methods

Method Description
scopeVisibleTo ( Builder $query, User $actor = null ) : Builder Scope a query to only include records that are visible to a user.

Method Details

findOrFail() public method

Find a user by ID, optionally making sure it is visible to a certain user, or throw an exception.
public findOrFail ( integer $id, User $actor = null ) : Group
$id integer
$actor Flarum\Core\User
return Flarum\Core\Group

query() public method

Get a new query builder for the groups table.
public query ( ) : Builder
return Illuminate\Database\Eloquent\Builder

scopeVisibleTo() protected method

Scope a query to only include records that are visible to a user.
protected scopeVisibleTo ( Builder $query, User $actor = null ) : Builder
$query Illuminate\Database\Eloquent\Builder
$actor Flarum\Core\User
return Illuminate\Database\Eloquent\Builder