From 29572969d06e32db90045788455586f7b2fc9e07 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Mon, 24 Oct 2011 15:27:15 +0200 Subject: event overlapping funktioniert jetzt --- library/Poolctrl/Validate/EventOverlapping.php | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'library') diff --git a/library/Poolctrl/Validate/EventOverlapping.php b/library/Poolctrl/Validate/EventOverlapping.php index f2a0779..b28630b 100755 --- a/library/Poolctrl/Validate/EventOverlapping.php +++ b/library/Poolctrl/Validate/EventOverlapping.php @@ -10,10 +10,10 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract ); protected $_messageVariables = array( - 'overlappingEvent' => '_overlappingEvent', + 'overlappingEvent' => '_overlappingevent', ); - protected $_end; + protected $_start; protected $_poolID; protected $_overlappingevent; @@ -24,11 +24,11 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract } if (is_array($option)) { - if (array_key_exists('end', $option)) { - $_end = strtotime($option['end']); + if (array_key_exists('start', $option)) { + $_start = strtotime($option['start']); } else { require_once 'Zend/Validate/Exception.php'; - throw new Zend_Validate_Exception("Missing option 'end'"); + throw new Zend_Validate_Exception("Missing option 'start'"); } if (array_key_exists('poolID', $option)) { $_poolID = $option['poolID']; @@ -38,18 +38,18 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract } } - $this->_setEnd($_end); + $this->_setStart($_start); $this->_setPoolID($_poolID); } - public function _getEnd() + public function _getStart() { - return $this->_end; + return $this->_start; } - public function _setEnd($_end) + public function _setStart($_start) { - $this->_end = $_end; + $this->_start = $_start; } public function _getOverlappingevent() @@ -57,9 +57,9 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract return $this->_overlappingevent; } - public function _setOverlappingevent($overlappingevent) + public function _setOverlappingevent($_overlappingevent) { - $this->_overlappingevent = $overlappingevent; + $this->_overlappingevent = $_overlappingevent; } public function _getPoolID() @@ -76,7 +76,7 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract { $this->_setValue(strtotime($value)); $eventMapper = new Application_Model_EventMapper(); - $overlappingEvents = $eventMapper->getOverlappingEvents($this->_value, $this->_end); + $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()); @@ -85,4 +85,4 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract } return true; } -} \ No newline at end of file +} -- cgit v1.2.3-55-g7522