Bristol SU Support Package
|
Public Member Functions | |
active () | |
getForParticipant (?User $user=null, ?Group $group=null, ?Role $role=null) | |
getForAdministrator (?User $user=null, ?Group $group=null, ?Role $role=null) | |
all () | |
create (array $attributes) | |
getById ($id) | |
update ($id, $attributes) | |
delete ($id) | |
Handles creating and retrieving Activities.
Definition at line 17 of file Repository.php.
BristolSU\Support\Activity\Contracts\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 enabled
Implemented in BristolSU\Support\Activity\Repository.
BristolSU\Support\Activity\Contracts\Repository::all | ( | ) |
BristolSU\Support\Activity\Contracts\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' ]
array | $attributes | Array of attributes to create the activity with |
Implemented in BristolSU\Support\Activity\Repository.
BristolSU\Support\Activity\Contracts\Repository::delete | ( | $id | ) |
Delete an activity by ID
int | $id | ID of the activity |
ModelNotFoundException |
Implemented in BristolSU\Support\Activity\Repository.
BristolSU\Support\Activity\Contracts\Repository::getById | ( | $id | ) |
Get an activity by ID
int | $id | ID of the activity |
ModelNotFoundException |
Implemented in BristolSU\Support\Activity\Repository.
BristolSU\Support\Activity\Contracts\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 |
Implemented in BristolSU\Support\Activity\Repository.
BristolSU\Support\Activity\Contracts\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 |
Implemented in BristolSU\Support\Activity\Repository.
BristolSU\Support\Activity\Contracts\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' ]
$id | |
$attributes |
ModelNotFoundException |
Implemented in BristolSU\Support\Activity\Repository.