Fix non existing class errors

This commit is contained in:
Thilina Hasantha
2019-09-05 06:32:07 +02:00
parent 91bb1d2d8a
commit 60c92d7935
2 changed files with 9 additions and 6 deletions
@@ -215,11 +215,13 @@ class TimeSheetsActionManager extends SubActionManager
$data[] = $this->workScheduleToEvent($leave);
}
$holiday = new HoliDay();
$holidays = $holiday->Find("1=1", array());
if (class_exists('\Leaves\Common\Model\HoliDay')) {
$holiday = new HoliDay();
$holidays = $holiday->Find("1=1", array());
foreach ($holidays as $holiday) {
$data[] = $this->holidayToEvent($holiday);
foreach ($holidays as $holiday) {
$data[] = $this->holidayToEvent($holiday);
}
}
echo json_encode($data);