* @package WB */ WBClass::load('WBDatasource_Calendar_Decorator'); /** * Populate form element's values with entity list * * Datasource Calendar Decorator Public Holiday * * @version 0.3.0 * @package WB */ class WBDatasource_Calendar_Decorator_PublicHoliday extends WBDatasource_Calendar_Decorator { /** * @var WBDatasource_Calendar_Holiday */ private $holiday; /** * 2nd Constructor */ protected function init() { $this->holiday = WBClass::create('WBDatasource_Calendar_Holiday'); } /** * Decorate Day * * @param DateTime * @param array data of complete week * @param int week day 1 to 7 */ public function decorateDay($date, &$week, $dow) { $today = $date->format('Y-m-d'); if (!$this->holiday->isHoliday($today)) { return; } $week['day'. $dow. '_title'][] = $this->holiday->getTitle($today); $week['day'. $dow. '_class'][] = 'wb-holiday'; } /** * Decorate Week * * @param DateTime * @param array data of complete week */ public function decorateWeek($date, &$week) { } }