Пример #1
0
 /**
  * Private constructor to respect the singleton pattern
  */
 private function __construct()
 {
     self::$HolidayList = array();
     $query = 'SELECT * FROM `codev_holidays_table`';
     $result = SqlWrapper::getInstance()->sql_query($query);
     if (!$result) {
         echo "<span style='color:red'>ERROR: Query FAILED</span>";
         exit;
     }
     while ($row = SqlWrapper::getInstance()->sql_fetch_object($result)) {
         self::$HolidayList[$row->id] = new Holiday($row->id, $row->date, $row->description, $row->color);
     }
 }