public static function run($dataDir = null)
 {
     $except = new CalendarException();
     $except->setEnteredByOccurrences(true);
     $except->setOccurrences(5);
     $calendarExceptionType = new CalendarExceptionType();
     $except->setType($calendarExceptionType->YearlyByDay);
     print "Set Occurences for exeptions" . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate project object
     $project = new Project($dataDir . 'test_tasks.mpp');
     $cal = $project->getCalendars()->toList()->get(0);
     # Add an exception
     $calExc = new CalendarException();
     $calendar = new Calendar();
     $calObject = $calendar->getInstance();
     $calObject->set(2009, 1, 1, 0, 0, 0);
     $calExc->setFromDate($calObject->getTime());
     $calObject->set(2009, 1, 3, 0, 0, 0);
     $calExc->setToDate($calObject->getTime());
     $cal->getExceptions()->add($calExc);
     print "Added calendar excpetion." . PHP_EOL;
 }
 public static function run($dataDir = null)
 {
     # Instantiate project object
     $project = new Project($dataDir . 'test_tasks.mpp');
     #Define Calendar
     $cal = $project->getCalendars()->add("Calendar1");
     # Define week days exception for christmis
     $except = new CalendarException();
     $except->setEnteredByOccurrences(false);
     $calendar = new Calendar();
     $calendarExceptionType = new CalendarExceptionType();
     $cal_object = $calendar->getInstance();
     $cal_object->set(2009, 12, 24, 0, 0, 0);
     $except->setFromDate($cal_object->getTime());
     $cal_object->set(2009, 12, 31, 23, 59, 0);
     $except->setToDate($cal_object->getTime());
     $except->setType($calendarExceptionType->Daily);
     $except->setDayWorking(false);
     $cal->getExceptions()->add($except);
     print "Defined weekdays for exceptions." . PHP_EOL;
 }