summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-25 17:43:19 +0200
committerSebastian Wagner2011-10-25 17:43:19 +0200
commit6212159c89402e562e5a66bf01cc05bc3b8f7b69 (patch)
tree321a5ac9d6f8aafe28df2c678cac5c260e4a982f /library
parentwas weiß ich (diff)
downloadpoolctrl-6212159c89402e562e5a66bf01cc05bc3b8f7b69.tar.gz
poolctrl-6212159c89402e562e5a66bf01cc05bc3b8f7b69.tar.xz
poolctrl-6212159c89402e562e5a66bf01cc05bc3b8f7b69.zip
was weiß ich
Diffstat (limited to 'library')
-rwxr-xr-xlibrary/Poolctrl/Validate/EventOverlapping.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/library/Poolctrl/Validate/EventOverlapping.php b/library/Poolctrl/Validate/EventOverlapping.php
index b28630b..f3f1d71 100755
--- a/library/Poolctrl/Validate/EventOverlapping.php
+++ b/library/Poolctrl/Validate/EventOverlapping.php
@@ -6,16 +6,12 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract
const EVENT_OVERLAPPING = 'overlapping';
protected $_messageTemplates = array(
- self::EVENT_OVERLAPPING => "This Event is overlapping the Event %overlappingEvent%",
- );
-
- protected $_messageVariables = array(
- 'overlappingEvent' => '_overlappingevent',
+ self::EVENT_OVERLAPPING => "This Event is overlapping an other Event",
);
protected $_start;
+ protected $_repeat;
protected $_poolID;
- protected $_overlappingevent;
public function __construct($option)
{
@@ -36,9 +32,16 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract
require_once 'Zend/Validate/Exception.php';
throw new Zend_Validate_Exception("Missing option 'poolID'");
}
+ if (array_key_exists('repeat', $option)) {
+ $_repeat = strtotime($option['repeat']);
+ } else {
+ require_once 'Zend/Validate/Exception.php';
+ throw new Zend_Validate_Exception("Missing option 'repeat'");
+ }
}
$this->_setStart($_start);
+ $this->_setRepeat($r_repeat);
$this->_setPoolID($_poolID);
}
@@ -52,14 +55,14 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract
$this->_start = $_start;
}
- public function _getOverlappingevent()
+ public function _getRepeat()
{
- return $this->_overlappingevent;
+ return $this->_repeat;
}
- public function _setOverlappingevent($_overlappingevent)
+ public function _setRepeat($_repeat)
{
- $this->_overlappingevent = $_overlappingevent;
+ $this->_repeat = $_repeat;
}
public function _getPoolID()
@@ -79,7 +82,6 @@ class Poolctrl_Validate_EventOverlapping extends Zend_Validate_Abstract
$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;
}