"This Event is overlapping the Event %overlappingEvent%", ); protected $_messageVariables = array( 'overlappingEvent' => '_overlappingevent', ); protected $_start; protected $_poolID; protected $_overlappingevent; public function __construct($option) { if ($option instanceof Zend_Config) { $option = $option->toArray(); } if (is_array($option)) { if (array_key_exists('start', $option)) { $_start = strtotime($option['start']); } else { require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option 'start'"); } if (array_key_exists('poolID', $option)) { $_poolID = $option['poolID']; } else { require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option 'poolID'"); } } $this->_setStart($_start); $this->_setPoolID($_poolID); } public function _getStart() { return $this->_start; } public function _setStart($_start) { $this->_start = $_start; } public function _getOverlappingevent() { return $this->_overlappingevent; } public function _setOverlappingevent($_overlappingevent) { $this->_overlappingevent = $_overlappingevent; } public function _getPoolID() { return $this->_poolID; } public function _setPoolID($_poolID) { $this->_poolID = $_poolID; } public function isValid($value) { $this->_setValue(strtotime($value)); $eventMapper = new Application_Model_EventMapper(); $overlappingEvents = $eventMapper->getOverlappingEvents(date('Y-m-d H:i:s', $this->_start), date('Y-m-d H:i:s', $this->_value), $this->_poolID); if (count($overlappingEvents) > 0) { $this->_setOverlappingevent($overlappingEvents[0]->getTitle()); $this->_error(self::EVENT_OVERLAPPING); return false; } return true; } }