Пример #1
0
 /**
  * Checks if given day exists in the set
  * @param Day $day
  * @return boolean
  */
 public function has(Day $day)
 {
     if (isset($this->days[$day->getMonth()][$day->getDay()])) {
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * Checks if day is earlier than another day
  * @param Day $day
  * @return boolean
  */
 public function isEarlierThan(Day $day)
 {
     if ($this->getMonth() < $day->getMonth()) {
         return true;
     } elseif ($this->getMonth() == $day->getMonth()) {
         if ($this->getDay() < $day->getDay()) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }