Bristol SU Support Package
|
Public Member Functions | |
scopeForResource (Builder $query, $activityInstanceId=null, $moduleInstanceId=null) | |
scopeForModuleInstance (Builder $query, $moduleInstanceId=null) | |
Static Public Member Functions | |
static | bootHasResource () |
static | moduleInstanceId () |
static | activityInstanceId () |
Adds features for Module Instance and Activity Instance id references
static Builder forResource(int $activityInstanceId = null, int $moduleInstanceId = null) static Builder forModuleInstance(int $moduleInstanceId = null)
Definition at line 16 of file HasResource.php.
|
static |
|
static |
Boot the trait
When a model is saved, if activity_instance_id or module_instance_id are null they will be set to the id of the model resolved from the container.
Definition at line 25 of file HasResource.php.
|
static |
Returns the module instance resolved from the container
Definition at line 43 of file HasResource.php.
BristolSU\Support\Authentication\HasResource::scopeForModuleInstance | ( | Builder | $query, |
$moduleInstanceId = null |
|||
) |
Return all models for the current module instance
A scope for the admin side of a module, where it returns all models which are associated to the current module instance
Builder | $query | |
null | $moduleInstanceId |
Definition at line 84 of file HasResource.php.
BristolSU\Support\Authentication\HasResource::scopeForResource | ( | Builder | $query, |
$activityInstanceId = null , |
|||
$moduleInstanceId = null |
|||
) |
Retrieves models for the current user
A scope to select only items which have the module instance and activity as are being used. Use on the participant side of modules to quickly retrieve models accessible by the user.
Make sure to create two unsignedBigInt rows on the table called 'activity_instance_id' and 'module_instance_id'
Builder | $query |
Definition at line 70 of file HasResource.php.