summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorBjörn Geiger2011-10-24 15:27:15 +0200
committerBjörn Geiger2011-10-24 15:27:15 +0200
commit29572969d06e32db90045788455586f7b2fc9e07 (patch)
treec0f2675726d18a69ab614924773aac408c705398 /library
parentnochmal Korrektur2 (diff)
downloadpoolctrl-29572969d06e32db90045788455586f7b2fc9e07.tar.gz
poolctrl-29572969d06e32db90045788455586f7b2fc9e07.tar.xz
poolctrl-29572969d06e32db90045788455586f7b2fc9e07.zip
event overlapping funktioniert jetzt
Diffstat (limited to 'library')
-rwxr-xr-xlibrary/Poolctrl/Validate/EventOverlapping.php28
1 files changed, 14 insertions, 14 deletions
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
+}