Download the PHP package imagina/ischedulable-module without Composer
On this page you can find all versions of the php package imagina/ischedulable-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ischedulable-module
imaginacms-ischedulable
Polymorphic module to relate a schedule entity
To use, Run migrations and seeds.
Install
Enable the module
Traits
-
schedulable
Synchronize schedules related to your model. Listen the Event
createdWithBindings
andupdatedWithBindings
to do it.-
Relations
- schedule
morphOne
Return all related schedule of your model. - schedule.workTimes
hasMany
Return all related schedule with their workTimes. - schedule.workTimes.day
belongsTo
Return all related schedule with their workTimes and their day.
- schedule
-
Use
Use the
Schedulable
Trait in your entity.When you are creating or updating your entity, add the schedule data to sync it.
Sync: Only when the entity data has the
schedule
attribute the trait will make the sync.Remove: To remove the schedule of the entity, sent in the entity data the attribute
schedule
asfalse
.
-
Entities
-
Schedule
Save Polymorphic Schedules
-
Relations
- worktimes
hasMany
Return all related workTime of schedule.
- worktimes
-
Methods
-
getShifts(['dateRange','busyShifts']) Return all shifts according to worktimes of the schedule by intervals of minutes.
To get shifts with the day model add in request the relation
workTimes.day
- Parameters
- dateRange
Array
one array with the date range to generate the shifts, if not exist this parameter will loaded the current date until 6 days in future.
- ***busyShifts*** `Array of Arrays` Array with the busy shift reference to validate if shift generate by the method is busy or not.
- Response
Yo get shifts orderer by calendarDate, dayId and startTime on asc way
-
-
-
WorkTime
Save one or many work time to schedule
-
Relations
- day
belongsTo
Return the Day model. - schedule
belongsTo
Return the Schedule model
- day
-
Methods
- getShifts() Generate and return the shifts of the current worktime.
-
-
Day
Has the translatable week days with the iso number
Day ISO Monday 1 Tuesday 2 Wednesday 3 Thursday 4 Friday 5 Saturday 6 Sunday 7