Bristol SU Support Package
Public Member Functions | List of all members
BristolSU\Support\ActivityInstance\ActivityInstanceRepository Class Reference
Inheritance diagram for BristolSU\Support\ActivityInstance\ActivityInstanceRepository:
Inheritance graph
[legend]
Collaboration diagram for BristolSU\Support\ActivityInstance\ActivityInstanceRepository:
Collaboration graph
[legend]

Public Member Functions

 firstFor (int $activityId, string $resourceType, int $resourceId)
 
 create (int $activityId, string $resourceType, int $resourceId, string $name, ?string $description)
 
 getById ($id)
 
 allFor (int $activityId, string $resourceType, int $resourceId)
 
 allForActivity (int $activityId)
 

Detailed Description

Repository for an eloquent-based activity instance.

Definition at line 11 of file ActivityInstanceRepository.php.

Member Function Documentation

◆ allFor()

BristolSU\Support\ActivityInstance\ActivityInstanceRepository::allFor ( int  $activityId,
string  $resourceType,
int  $resourceId 
)

Get all activity instances with the given parameters

Parameters
int$activityIdID of the activity to which the activity instances should belong
string$resourceTypeResource (owner) type. One of user, group or role.
int$resourceIdResource (owner) id. ID of the model in resource type.
Returns
Collection

Implements BristolSU\Support\ActivityInstance\Contracts\ActivityInstanceRepository.

Definition at line 73 of file ActivityInstanceRepository.php.

◆ allForActivity()

BristolSU\Support\ActivityInstance\ActivityInstanceRepository::allForActivity ( int  $activityId)

Get all activity instances belonging to an activity

Parameters
int$activityIdID Of the activity
Returns
Collection

Implements BristolSU\Support\ActivityInstance\Contracts\ActivityInstanceRepository.

Definition at line 89 of file ActivityInstanceRepository.php.

◆ create()

BristolSU\Support\ActivityInstance\ActivityInstanceRepository::create ( int  $activityId,
string  $resourceType,
int  $resourceId,
string  $name,
?string  $description 
)

Create a new Activity Instance

Parameters
int$activityIdID of the activity to which the activity instance should belong
string$resourceTypeResource (owner) type. One of user, group or role.
int$resourceIdResource (owner) id. ID of the model in resource type.
string$nameName of the activity instance.
string | null$descriptionDescription for the activity instance.
Returns
ActivityInstance

Implements BristolSU\Support\ActivityInstance\Contracts\ActivityInstanceRepository.

Definition at line 42 of file ActivityInstanceRepository.php.

◆ firstFor()

BristolSU\Support\ActivityInstance\ActivityInstanceRepository::firstFor ( int  $activityId,
string  $resourceType,
int  $resourceId 
)

Get the first activity instance found with the given parameters

Parameters
int$activityIdID of the activity to which the activity instance should belong
string$resourceTypeResource (owner) type. One of user, group or role.
int$resourceIdResource (owner) id. ID of the model in resource type.
Returns
ActivityInstance

Implements BristolSU\Support\ActivityInstance\Contracts\ActivityInstanceRepository.

Definition at line 22 of file ActivityInstanceRepository.php.

◆ getById()

BristolSU\Support\ActivityInstance\ActivityInstanceRepository::getById (   $id)

Get an activity instance by ID

Parameters
int$idID of the activity instance
Returns
ActivityInstance

Implements BristolSU\Support\ActivityInstance\Contracts\ActivityInstanceRepository.

Definition at line 59 of file ActivityInstanceRepository.php.


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