Bristol SU Support Package
|
Public Member Functions | |
getForAdministrator (?User $user=null, ?Group $group=null, ?Role $role=null) | |
active () | |
getForParticipant (?User $user=null, ?Group $group=null, ?Role $role=null) | |
all () | |
create (array $attributes) | |
getById ($id) | |
update ($id, $attributes) | |
delete ($id) | |
Activity Repository implementation using Eloquent
Definition at line 16 of file Repository.php.
BristolSU\Support\Activity\Repository::active | ( | ) |
Retrieve all active activities.
This method should return all activities that're currently active. This currently just means they are within their active timeframe and they're turned on,
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 45 of file Repository.php.
Referenced by BristolSU\Support\Activity\Repository\getForAdministrator(), and BristolSU\Support\Activity\Repository\getForParticipant().
BristolSU\Support\Activity\Repository::all | ( | ) |
Return all activities
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 80 of file Repository.php.
BristolSU\Support\Activity\Repository::create | ( | array | $attributes | ) |
Create an activity
Create an activity using the given attributes. The attributes can be taken from the following: [ 'name' => 'Activity Name', 'description' => 'Activity Description', 'activity_for' => 'user', 'for_logic' => '1', 'admin_logic' => 2, 'start_date' => null, 'end_date' => null, 'slug' => 'activity-slug', 'type' => 'open', 'enabled' => true ]
array | $attributes | Array of attributes to create the activity with |
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 105 of file Repository.php.
BristolSU\Support\Activity\Repository::delete | ( | $id | ) |
Delete an activity by ID
int | $id | ID of the activity |
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 162 of file Repository.php.
References BristolSU\Support\Activity\Repository\getById().
BristolSU\Support\Activity\Repository::getById | ( | $id | ) |
Get an activity by ID
int | $id | ID of the activity |
ModelNotFoundException |
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 119 of file Repository.php.
Referenced by BristolSU\Support\Activity\Repository\delete(), and BristolSU\Support\Activity\Repository\update().
BristolSU\Support\Activity\Repository::getForAdministrator | ( | ?User | $user = null , |
?Group | $group = null , |
||
?Role | $role = null |
||
) |
Return all admin activities for a user
Return all the admin for which the given user, group and role satisfy the forLogic group.
User | null | $user | |
Group | null | $group | |
Role | null | $role |
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 29 of file Repository.php.
References BristolSU\Support\Activity\Repository\active().
BristolSU\Support\Activity\Repository::getForParticipant | ( | ?User | $user = null , |
?Group | $group = null , |
||
?Role | $role = null |
||
) |
Return all participant activities for a user
Return all the activities for which the given user, group and role satisfy the forLogic group.
User | null | $user | |
Group | null | $group | |
Role | null | $role |
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 67 of file Repository.php.
References BristolSU\Support\Activity\Repository\active().
BristolSU\Support\Activity\Repository::update | ( | $id, | |
$attributes | |||
) |
Update an activity
Update an activity using the given attributes. The attributes can be taken from the following: [ 'name' => 'Activity Name', 'description' => 'Activity Description', 'activity_for' => 'user', 'for_logic' => '1', 'admin_logic' => 2, 'start_date' => null, 'end_date' => null, 'slug' => 'activity-slug', 'type' => 'open', 'enabled' => true ]
$id | |
$attributes |
ModelNotFoundException |
Implements BristolSU\Support\Activity\Contracts\Repository.
Definition at line 146 of file Repository.php.
References BristolSU\Support\Activity\Repository\getById().