Bristol SU Support Package
Public Member Functions | List of all members
BristolSU\Support\Activity\Contracts\Repository Interface Reference
Inheritance diagram for BristolSU\Support\Activity\Contracts\Repository:
Inheritance graph
[legend]

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)
 

Detailed Description

Activity Repository.

Handles creating and retrieving Activities.

Definition at line 17 of file Repository.php.

Member Function Documentation

◆ active()

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

Returns
Collection

Implemented in BristolSU\Support\Activity\Repository.

◆ all()

BristolSU\Support\Activity\Contracts\Repository::all ( )

Return all activities

Returns
Collection

Implemented in BristolSU\Support\Activity\Repository.

◆ create()

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' ]

Parameters
array$attributesArray of attributes to create the activity with
Returns
Activity

Implemented in BristolSU\Support\Activity\Repository.

◆ delete()

BristolSU\Support\Activity\Contracts\Repository::delete (   $id)

Delete an activity by ID

Parameters
int$idID of the activity
Returns
void
Exceptions
ModelNotFoundException

Implemented in BristolSU\Support\Activity\Repository.

◆ getById()

BristolSU\Support\Activity\Contracts\Repository::getById (   $id)

Get an activity by ID

Parameters
int$idID of the activity
Returns
Activity
Exceptions
ModelNotFoundException

Implemented in BristolSU\Support\Activity\Repository.

◆ getForAdministrator()

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.

Parameters
User | null$user
Group | null$group
Role | null$role
Returns
Collection

Implemented in BristolSU\Support\Activity\Repository.

◆ getForParticipant()

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.

Parameters
User | null$user
Group | null$group
Role | null$role
Returns
Collection

Implemented in BristolSU\Support\Activity\Repository.

◆ update()

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' ]

Parameters
$id
$attributes
Returns
Activity
Exceptions
ModelNotFoundException

Implemented in BristolSU\Support\Activity\Repository.


The documentation for this interface was generated from the following file: