Skip to content

Commit bc5314a

Browse files
Timeline/Rotation: Add getter getScheduleId()
Use getter intead of class properties
1 parent abf448f commit bc5314a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

library/Notifications/Widget/Timeline/Rotation.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ public function getId(): int
3939
return $this->model->id;
4040
}
4141

42+
/**
43+
* Get the schedule ID of the rotation
44+
*
45+
* @return int
46+
*/
47+
public function getScheduleId(): int
48+
{
49+
return $this->model->schedule_id;
50+
}
51+
4252
/**
4353
* Get the name of the rotation
4454
*
@@ -137,7 +147,7 @@ public function fetchTimeperiodEntries(DateTime $after, DateTime $until): Genera
137147
->setMember($member)
138148
->setStart($recurrence)
139149
->setEnd($recurrenceEnd)
140-
->setUrl(Links::rotationSettings($this->model->id, $this->model->schedule_id));
150+
->setUrl(Links::rotationSettings($this->getId(), $this->getScheduleId()));
141151

142152
yield $occurrence;
143153
}
@@ -146,7 +156,7 @@ public function fetchTimeperiodEntries(DateTime $after, DateTime $until): Genera
146156
->setMember($member)
147157
->setStart($timeperiodEntry->start_time)
148158
->setEnd($timeperiodEntry->end_time)
149-
->setUrl(Links::rotationSettings($this->model->id, $this->model->schedule_id));
159+
->setUrl(Links::rotationSettings($this->getId(), $this->getScheduleId()));
150160

151161
yield $entry;
152162
}

0 commit comments

Comments
 (0)