1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
	protected function validate(){
		$validator = new ValidationResult();

		if(strtotime($this->StartDate) < strtotime("-7 years") ) {
			$validator->error(_t('DiscountCouponOption.NOSTARTDATE', "Please enter a start date"));
		}
		if(strtotime($this->EndDate) < strtotime("-7 years") ) {
			$validator->error(_t('DiscountCouponOption.NOENDDATE', "Please enter an end date"));
		}
		if(strtotime($this->EndDate) < strtotime($this->StartDate)) {
			$validator->error(_t('DiscountCouponOption.ENDDATETOOEARLY', "The end date should be after the start date"));
		}
		return $validator;
	}