summaryrefslogtreecommitdiff
path: root/src/Models/Shifts/ScheduleShift.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-11-27 23:43:21 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-12-08 02:20:48 +0100
commit42721e95726559b4a601240bb5b0fe4e5d755b2a (patch)
tree6810e05f845ca787acc1d02fa82d3df15cd0ef9b /src/Models/Shifts/ScheduleShift.php
parent377b390c97afb9106fd9a139819d00306f996f24 (diff)
Added Schedule parsing and replaced old Fahrplan importer
Resolves #553 (Change Frab Import from xCal to XML) Resolves #538 (Feature Request: Multi Frab Import)
Diffstat (limited to 'src/Models/Shifts/ScheduleShift.php')
-rw-r--r--src/Models/Shifts/ScheduleShift.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Models/Shifts/ScheduleShift.php b/src/Models/Shifts/ScheduleShift.php
new file mode 100644
index 00000000..368c60b1
--- /dev/null
+++ b/src/Models/Shifts/ScheduleShift.php
@@ -0,0 +1,38 @@
+<?php
+
+namespace Engelsystem\Models\Shifts;
+
+use Engelsystem\Models\BaseModel;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Query\Builder as QueryBuilder;
+
+/**
+ * @property int $shift_id
+ * @property int $schedule_id
+ * @property string $guid
+ *
+ * @property-read QueryBuilder|Schedule $schedule
+ *
+ * @method static QueryBuilder|ScheduleShift[] whereShiftId($value)
+ * @method static QueryBuilder|ScheduleShift[] whereScheduleId($value)
+ * @method static QueryBuilder|ScheduleShift[] whereGuid($value)
+ */
+class ScheduleShift extends BaseModel
+{
+ /** @var string The primary key for the model */
+ protected $primaryKey = 'shift_id';
+
+ /** @var string Required because it is not schedule_shifts */
+ protected $table = 'schedule_shift';
+
+ /** @var array Values that are mass assignable */
+ protected $fillable = ['shift_id', 'schedule_id', 'guid'];
+
+ /**
+ * @return BelongsTo
+ */
+ public function schedule()
+ {
+ return $this->belongsTo(Schedule::class);
+ }
+}