Bristol SU Support Package
|
Public Member Functions | |
getById (int $id) | |
create (array $attributes) | |
all () | |
allWithAlias (string $alias='') | |
allThroughActivity (Activity $activity) | |
allEnabledThroughActivity (Activity $activity) | |
update (int $id, array $attributes=[]) | |
delete (int $id) | |
Class to interact with module instances through
Definition at line 16 of file ModuleInstanceRepository.php.
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::all | ( | ) |
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 52 of file ModuleInstanceRepository.php.
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::allEnabledThroughActivity | ( | Activity | $activity | ) |
Get all enabled module instances that belong to a given activity
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 84 of file ModuleInstanceRepository.php.
References BristolSU\Support\Activity\Activity\moduleInstances().
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::allThroughActivity | ( | Activity | $activity | ) |
Get all module instances that belong to a given activity
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 72 of file ModuleInstanceRepository.php.
References BristolSU\Support\Activity\Activity\moduleInstances().
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::allWithAlias | ( | string | $alias = '' | ) |
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 60 of file ModuleInstanceRepository.php.
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::create | ( | array | $attributes | ) |
Create a new module instance
The attributes must be of the following form: [ 'alias' => 'alias_of_the_module', '' => '', ]
array | $attributes |
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 44 of file ModuleInstanceRepository.php.
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::delete | ( | int | $id | ) |
Delete a module instance
int | $id |
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 115 of file ModuleInstanceRepository.php.
References BristolSU\Support\ModuleInstance\ModuleInstanceRepository\getById().
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::getById | ( | int | $id | ) |
Get a module instance by ID
int | $id | ID of the module instance |
ModelNotFoundException | If the model does not exist. |
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 27 of file ModuleInstanceRepository.php.
Referenced by BristolSU\Support\ModuleInstance\ModuleInstanceRepository\delete(), and BristolSU\Support\ModuleInstance\ModuleInstanceRepository\update().
BristolSU\Support\ModuleInstance\ModuleInstanceRepository::update | ( | int | $id, |
array | $attributes = [] |
||
) |
Update a module instance
Parameters should be of the form ['key' => 'newValue']. Multiple values may be updated at the same time. Available keys are alias, activity_id, name, description, slug, active, visible, mandatory, completion_condition_instance_id, enabled, user_id
int | $id | ID of the module instance |
array | $attributes | Attributes to be updated |
Implements BristolSU\Support\ModuleInstance\Contracts\ModuleInstanceRepository.
Definition at line 101 of file ModuleInstanceRepository.php.
References BristolSU\Support\ModuleInstance\ModuleInstanceRepository\getById().