Example #1
0
 /**
  * Check dates.
  *
  * @return bool
  */
 public function isValid()
 {
     if (!parent::isValid()) {
         return false;
     }
     if (!checkdate("-" . $this->getMonth(), $this->getDay(), $this->getYear())) {
         throw new Exception("invalid date: " . $this->__toString());
     }
     return true;
 }
Example #2
0
 /**
  * Overload isValid to for additional date checks.
  *
  * @return bool
  */
 public function isValid()
 {
     return checkdate($this->getMonth(), $this->getDay(), $this->getYear()) and parent::isValid();
 }