HofUniversityCanteenData is a small functional libary for accessing and filtering the canteen plan of Hof University.
It is written in PHP 7.3 and above. HofUniversityCanteenData is not supported nor endorsed by Studentenwerk Oberfranken or Hochschule Hof.
classDiagram
Week "1" -- "n" Day
Day "1" -- "n" Dish
class Week{
+array days
}
class Day{
+string name
+DateTime date
+array mainCourses
+array sideDishes
+array desserts
+array salads
}
class Dish{
+string name
+array attributes
+double collegeStudentPrice
}
Just copy the "HofUniversityCanteenData"-folder in your project and import the the used functions:
include "HofUniversityCanteenData/Helper.php";
use function HofUniversityCanteenData\convertAllUnconvertedDataToWeek;
use function HofUniversityCanteenData\convertWeekToFormatedGermanString;
use function HofUniversityCanteenData\downloadAllUnconvertedData;
use function HofUniversityCanteenData\filterWeekByAttributeIdsAndDayNumber;
You can use the following self-explanatory functions:
getAttributeIdsTable():arraydownloadAllUnconvertedData(dayNumber:int, monthNumber:int):SimpleXMLElementconvertAllUnconvertedDataToWeek(allUnconvertedData:SimpleXMLElement):WeekfilterWeekByAttributeIdsAndDayNumber(week:Week, attributeIds:array, dayNumber:int):WeekconvertWeekToFormatedGermanString(week:Week):string
The library was tested manually. I could not find any bugs, but there still may be some.
You can find a realistic example here.
Feel free to get in contact and share your experience with HofUniversityCanteenData. Bug reports are also very appreciated.