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

Public Member Functions

 __construct (array $attributes=[])
 
 moduleInstances ()
 
 scopeEnabled (Builder $query)
 
 forLogic ()
 
 adminLogic ()
 
 scopeActive (Builder $query)
 
 isCompletable ()
 
 activityInstances ()
 
 user ()
 
- Public Member Functions inherited from BristolSU\Support\Revision\HasRevisions
 initializeHasRevisions ()
 
 getSystemUserId ()
 

Protected Attributes

 $fillable
 
 $casts
 
- Protected Attributes inherited from BristolSU\Support\Revision\HasRevisions
 $historyLimit
 
 $revisionCleanup
 

Detailed Description

Activity Model

Definition at line 20 of file Activity.php.

Constructor & Destructor Documentation

◆ __construct()

BristolSU\Support\Activity\Activity::__construct ( array  $attributes = [])

Initialise an Activity model.

Set up creating event to set the slug automatically Save the User ID of the current user on creation

Parameters
array$attributes

Definition at line 61 of file Activity.php.

Member Function Documentation

◆ activityInstances()

BristolSU\Support\Activity\Activity::activityInstances ( )

Activity Instance relationship

Returns

Definition at line 148 of file Activity.php.

◆ adminLogic()

BristolSU\Support\Activity\Activity::adminLogic ( )

Admin logic relationship

Returns

Definition at line 110 of file Activity.php.

◆ forLogic()

BristolSU\Support\Activity\Activity::forLogic ( )

For logic relationship

Returns

Definition at line 100 of file Activity.php.

◆ isCompletable()

BristolSU\Support\Activity\Activity::isCompletable ( )

Is the activity completable?

Can the activity be completed? An open activity cannot, but a completable activity can be

Returns
bool

Definition at line 139 of file Activity.php.

◆ moduleInstances()

BristolSU\Support\Activity\Activity::moduleInstances ( )

◆ scopeActive()

BristolSU\Support\Activity\Activity::scopeActive ( Builder  $query)

Active scope

Only returns activities which are either not time sensitive, or within the correct time frame

Parameters
Builder$query
Returns
Builder

Definition at line 123 of file Activity.php.

◆ scopeEnabled()

BristolSU\Support\Activity\Activity::scopeEnabled ( Builder  $query)

Scope only enabled activities

Parameters
Builder$query
Returns
Builder

Definition at line 90 of file Activity.php.

◆ user()

BristolSU\Support\Activity\Activity::user ( )

Get the user who created the activity

Returns
Exceptions

Definition at line 159 of file Activity.php.

Member Data Documentation

◆ $casts

BristolSU\Support\Activity\Activity::$casts
protected
Initial value:
= [
'start_date' => 'datetime'

Definition at line 47 of file Activity.php.

◆ $fillable

BristolSU\Support\Activity\Activity::$fillable
protected
Initial value:
= [
'name',
'description',
'activity_for',
'for_logic',
'admin_logic',
'start_date',
'end_date',
'slug',
'type',
'enabled',
'user_id'
]

Definition at line 28 of file Activity.php.


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