From 54da4fa07b925badf406c8fae8daa48d26224d41 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 22 Sep 2011 17:56:43 +0200 Subject: Repeat Optionen werden nun in der DB gespeichert, achtung DB Update --- application/controllers/EventController.php | 119 +++++++++++++---------- application/forms/EventAdd.php | 89 +++++++++-------- application/forms/EventEdit.php | 105 ++++++++++++-------- application/models/DbTable/Eventtype.php | 20 ---- application/models/DbTable/Repeatend.php | 20 ++++ application/models/DbTable/Repeattype.php | 20 ++++ application/models/DbTable/Runningtype.php | 20 ++++ application/models/Event.php | 47 ++++++++- application/models/EventMapper.php | 12 ++- application/models/Eventtype.php | 111 ---------------------- application/models/EventtypeMapper.php | 142 ---------------------------- application/models/Repeatend.php | 110 +++++++++++++++++++++ application/models/RepeatendMapper.php | 138 +++++++++++++++++++++++++++ application/models/Repeattype.php | 110 +++++++++++++++++++++ application/models/RepeattypeMapper.php | 138 +++++++++++++++++++++++++++ application/models/Runningtype.php | 111 ++++++++++++++++++++++ application/models/RunningtypeMapper.php | 138 +++++++++++++++++++++++++++ 17 files changed, 1043 insertions(+), 407 deletions(-) delete mode 100755 application/models/DbTable/Eventtype.php create mode 100755 application/models/DbTable/Repeatend.php create mode 100755 application/models/DbTable/Repeattype.php create mode 100755 application/models/DbTable/Runningtype.php delete mode 100755 application/models/Eventtype.php delete mode 100755 application/models/EventtypeMapper.php create mode 100755 application/models/Repeatend.php create mode 100755 application/models/RepeatendMapper.php create mode 100755 application/models/Repeattype.php create mode 100755 application/models/RepeattypeMapper.php create mode 100755 application/models/Runningtype.php create mode 100755 application/models/RunningtypeMapper.php (limited to 'application') diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php index ce115c5..5e3901b 100755 --- a/application/controllers/EventController.php +++ b/application/controllers/EventController.php @@ -123,7 +123,10 @@ class EventController extends Zend_Controller_Action } } } - + $repeatendMapper = new Application_Model_RepeatendMapper(); + $repeatendlist = $repeatendMapper->fetchAll(); + $repeattypeMapper = new Application_Model_RepeattypeMapper(); + $repeattypelist = $repeattypeMapper->fetchAll(); $add = $this->getRequest()->getParam("add"); if($this->getRequest()->getParam('start')) { $start = date ('m/d/Y H:i', strtotime($this->getRequest()->getParam('start'))); @@ -144,12 +147,12 @@ class EventController extends Zend_Controller_Action } } if(isset($this->userIDsNamespace['poolID'])) { - $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'start' => $start, 'end' => $end, 'defaultEventCategoryID' => $defaultEventCategoryID, 'poolID' => $this->userIDsNamespace['poolID'])); + $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'repeatendlist' => $repeatendlist, 'repeattypelist' => $repeattypelist, 'start' => $start, 'end' => $end, 'defaultEventCategoryID' => $defaultEventCategoryID, 'poolID' => $this->userIDsNamespace['poolID'])); } else { - $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'start' => $start, 'end' => $end, 'defaultEventCategoryID' => $defaultEventCategoryID)); + $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'repeatendlist' => $repeatendlist, 'repeattypelist' => $repeattypelist, 'poollist' => $poollist, 'start' => $start, 'end' => $end, 'defaultEventCategoryID' => $defaultEventCategoryID)); } } else { - $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'start' => $start, 'end' => $end, $this->getRequest()->getParams())); + $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'repeatendlist' => $repeatendlist, 'repeattypelist' => $repeattypelist, 'start' => $start, 'end' => $end, $this->getRequest()->getParams())); $params = $this->getRequest()->getParams(); if(!isset($params['pbs_poolID'])) { $params['pbs_poolID'] = $this->userIDsNamespace['poolID']; @@ -167,10 +170,10 @@ class EventController extends Zend_Controller_Action } else { unset($params['end']); } - if($params['repeatEnd']) { - $params['repeatEnd'] = date ('Y-m-d H:i', strtotime($this->getRequest()->getParam('repeatEnd'))); + if($params['repeatdate']) { + $params['repeatdate'] = date ('Y-m-d H:i', strtotime($this->getRequest()->getParam('repeatdate'))); } else { - unset($params['repeatEnd']); + unset($params['repeatdate']); $params['repeat'] = 0; } } @@ -232,10 +235,10 @@ class EventController extends Zend_Controller_Action $eventcategories[$category->getID()] = $category->getTitle(); } $eventCategory = $eventcategories[$event->getCategory()]; - $eventtypeMapper = new Application_Model_EventtypeMapper(); - $eventtype = $eventtypeMapper->findBy(array("title" => $eventCategory)); + $runningtypeMapper = new Application_Model_RunningtypeMapper(); + $runningtype = $runningtypeMapper->findBy(array("title" => $eventCategory)); $event->setRunning(true); - $event->setRunningtype($eventtype[0]->getID()); + $event->setRunningtype($runningtype[0]->getID()); } else { $event->setRunning(false); } @@ -252,6 +255,9 @@ class EventController extends Zend_Controller_Action if($event->getImmediate()) { $this->runEvent($event, $this->userIDsNamespace['apikey']); } + if($event->repeat) { + repeatEvent($event); + } $this->_redirect('/event/'); } } @@ -355,10 +361,14 @@ class EventController extends Zend_Controller_Action $this->_redirect('/'); } } + $repeatendMapper = new Application_Model_RepeatendMapper(); + $repeatendlist = $repeatendMapper->fetchAll(); + $repeattypeMapper = new Application_Model_RepeattypeMapper(); + $repeattypelist = $repeattypeMapper->fetchAll(); $save = $this->getRequest()->getParam("save"); if (isset($save)){ $params = $this->getRequest()->getParams(); - $editForm = new Application_Form_EventEdit(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'params' => $params)); + $editForm = new Application_Form_EventEdit(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'repeattypelist' => $repeattypelist, 'repeatendlist' => $repeatendlist, 'params' => $params)); if ($editForm->isValid($params)) { $params['start'] = date ('Y-m-d H:i', strtotime($this->getRequest()->getParam('start'))); if($params['end']) { @@ -366,10 +376,10 @@ class EventController extends Zend_Controller_Action } else { unset($params['end']); } - if($params['repeatEnd']) { - $params['repeatEnd'] = date ('Y-m-d H:i', strtotime($this->getRequest()->getParam('repeatEnd'))); + if($params['repeatdate']) { + $params['repeatdate'] = date ('Y-m-d H:i', strtotime($this->getRequest()->getParam('repeatdate'))); } else { - unset($params['repeatEnd']); + unset($params['repeatdate']); $params['repeat'] = 0; } if($event->getPbs_bootmenuID()) { @@ -449,8 +459,17 @@ class EventController extends Zend_Controller_Action $this->getRequest()->setParam('end', $event->getEnd()); } $this->getRequest()->setParam('repeat', $event->getRepeat()); - if($event->getRepeatEnd()) { - $this->getRequest()->setParam('repeatEnd', $event->getRepeatEnd()); + if($event->getRepeattype()) { + $this->getRequest()->setParam('repeattype', $event->getRepeattype()); + } + if($event->getRepeatend()) { + $this->getRequest()->setParam('repeatend', $event->getRepeatend()); + } + if($event->getRepeatdate()) { + $this->getRequest()->setParam('repeatdate', $event->getRepeatdate()); + } + if($event->getRepeatings()) { + $this->getRequest()->setParam('repeatings', $event->getRepeatings()); } $this->getRequest()->setParam('participants', $event->getParticipants()); $this->getRequest()->setParam('category', $event->getCategory()); @@ -459,7 +478,7 @@ class EventController extends Zend_Controller_Action $this->getRequest()->setParam('pbs_bootosID', $event->getPbs_bootosID()); $this->getRequest()->setParam('pbs_membershipID', $event->getPbs_membershipID()); $params = $this->getRequest()->getParams(); - $editForm = new Application_Form_EventEdit(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist , 'params' => $params)); + $editForm = new Application_Form_EventEdit(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, 'repeattypelist' => $repeattypelist, 'repeatendlist' => $repeatendlist, 'params' => $params)); } $this->view->editForm = $editForm; $this->view->params = $params; @@ -685,7 +704,7 @@ class EventController extends Zend_Controller_Action } else { $apikey = $this->_request->getParam('apikey'); } - $eventtypeMapper = new Application_Model_EventtypeMapper(); + $runningtypeMapper = new Application_Model_RunningtypeMapper(); $results = array(); foreach($eventlist as $event) { $run = false; @@ -797,10 +816,10 @@ class EventController extends Zend_Controller_Action exit; } $results[$event->getTitle()] = $result; - $result = $eventtypeMapper->findBy(array("title" => "boot")); - $eventtypeBoot = $result[0]; + $result = $runningtypeMapper->findBy(array("title" => "boot")); + $runningtypeBoot = $result[0]; $event->setRunning(true); - $event->setRunningtype($eventtypeBoot->getID()); + $event->setRunningtype($runningtypeBoot->getID()); try { $this->eventMapper->save($event); } catch(Zend_Exception $e) @@ -818,10 +837,10 @@ class EventController extends Zend_Controller_Action exit; } $results[$event->getTitle()] = $result; - $result = $eventtypeMapper->findBy(array("title" => "shutdown")); - $eventtypeShutdown = $result[0]; + $result = $runningtypeMapper->findBy(array("title" => "shutdown")); + $runningtypeShutdown = $result[0]; $event->setRunning(true); - $event->setRunningtype($eventtypeShutdown->getID()); + $event->setRunningtype($runningtypeShutdown->getID()); try { $this->eventMapper->save($event); } catch(Zend_Exception $e) @@ -853,22 +872,22 @@ class EventController extends Zend_Controller_Action $this->_helper->viewRenderer->setNoRender(); $eventreportMapper = new Application_Model_EventreportMapper(); - $eventtypeMapper = new Application_Model_EventtypeMapper(); + $runningtypeMapper = new Application_Model_RunningtypeMapper(); $eventBootNames = array(); $eventShutdownNames = array(); $results = array(); - $result1 = $eventtypeMapper->findBy(array("title" => "boot")); - $result2 = $eventtypeMapper->findBy(array("title" => "shutdown")); - $eventtypeBoot = $result1[0]; - $eventtypeShutdown = $result2[0]; + $result1 = $runningtypeMapper->findBy(array("title" => "boot")); + $result2 = $runningtypeMapper->findBy(array("title" => "shutdown")); + $runningtypeBoot = $result1[0]; + $runningtypeShutdown = $result2[0]; $resultShortcutName = 'result shortcut'; $errorsName = 'clients errors'; $events = $this->eventMapper->findBy(array('running' => 1)); foreach($events as $event) { - if($event->getRunningtype() == $eventtypeBoot->getID()) { + if($event->getRunningtype() == $runningtypeBoot->getID()) { $eventBootNames[] = $event->getTitle(); - } else if($event->getRunningtype() == $eventtypeShutdown->getID()) { + } else if($event->getRunningtype() == $runningtypeShutdown->getID()) { $eventShutdownNames[] = $event->getTitle(); } } @@ -916,7 +935,7 @@ class EventController extends Zend_Controller_Action if($eventResult->$resultShortcutName == "failed") { $eventreport->setErrors(json_encode($eventResult->$errorsName)); } - $eventreport->setType($eventtypeBoot->getID()); + $eventreport->setType($runningtypeBoot->getID()); try { $eventreportMapper->save($eventreport); } catch(Zend_Exception $e) @@ -979,7 +998,7 @@ class EventController extends Zend_Controller_Action if($eventResult->$resultShortcutName == "failed") { $eventreport->setErrors(json_encode($eventResult->$errorsName)); } - $eventreport->setType($eventtypeShutdown->getID()); + $eventreport->setType($runningtypeShutdown->getID()); try { $eventreportMapper->save($eventreport); } catch(Zend_Exception $e) @@ -1022,16 +1041,16 @@ class EventController extends Zend_Controller_Action $this->eventMapper->find($eventID, $event); $eventreportMapper = new Application_Model_EventreportMapper(); $reportlist = $eventreportMapper->findBy(array("eventID" => $eventID), false, array('created' => 'DESC')); - $eventtypeMapper = new Application_Model_EventtypeMapper(); - $eventtypes = array(); - $result = $eventtypeMapper->fetchAll(); + $runningtypeMapper = new Application_Model_RunningtypeMapper(); + $runningtypes = array(); + $result = $runningtypeMapper->fetchAll(); if(count($result) > 0) { foreach($result as $type) { - $eventtypes[$type->getID()] = $type->getTitle(); + $runningtypes[$type->getID()] = $type->getTitle(); } } for($i = 0; $i < count($reportlist); $i++) { - $reportType = $eventtypes[$reportlist[$i]->getType()]; + $reportType = $runningtypes[$reportlist[$i]->getType()]; $reportlist[$i]->setType($reportType); } @@ -1152,7 +1171,7 @@ class EventController extends Zend_Controller_Action break; } - $eventtypeMapper = new Application_Model_EventtypeMapper(); + $runningtypeMapper = new Application_Model_RunningtypeMapper(); if($boot) { $bootOsRequest = "bootosid=" . $event->getPbs_bootosID(); $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $apikey, 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootOsRequest); @@ -1186,10 +1205,10 @@ class EventController extends Zend_Controller_Action exit; } $results[$event->getTitle()] = $result; - $result = $eventtypeMapper->findBy(array("title" => "boot")); - $eventtypeBoot = $result[0]; + $result = $runningtypeMapper->findBy(array("title" => "boot")); + $runningtypeBoot = $result[0]; $event->setRunning(true); - $event->setRunningtype($eventtypeBoot->getID()); + $event->setRunningtype($runningtypeBoot->getID()); try { $this->eventMapper->save($event); } catch(Zend_Exception $e) @@ -1207,10 +1226,10 @@ class EventController extends Zend_Controller_Action exit; } $results[$event->getTitle()] = $result; - $result = $eventtypeMapper->findBy(array("title" => "shutdown")); - $eventtypeShutdown = $result[0]; + $result = $runningtypeMapper->findBy(array("title" => "shutdown")); + $runningtypeShutdown = $result[0]; $event->setRunning(true); - $event->setRunningtype($eventtypeShutdown->getID()); + $event->setRunningtype($runningtypeShutdown->getID()); try { $this->eventMapper->save($event); } catch(Zend_Exception $e) @@ -1237,7 +1256,7 @@ class EventController extends Zend_Controller_Action break; } $eventreportMapper = new Application_Model_EventreportMapper(); - $eventtypeMapper = new Application_Model_EventtypeMapper(); + $runningtypeMapper = new Application_Model_RunningtypeMapper(); if($boot) { $data = array( 'type' => 'getBootState', @@ -1276,7 +1295,7 @@ class EventController extends Zend_Controller_Action if($eventResult->$resultShortcutName == "failed") { $eventreport->setErrors(json_encode($eventResult->$errorsName)); } - $eventreport->setType($eventtypeBoot->getID()); + $eventreport->setType($runningtypeBoot->getID()); try { $eventreportMapper->save($eventreport); } catch(Zend_Exception $e) @@ -1333,7 +1352,7 @@ class EventController extends Zend_Controller_Action if($eventResult->$resultShortcutName == "failed") { $eventreport->setErrors(json_encode($eventResult->$errorsName)); } - $eventreport->setType($eventtypeShutdown->getID()); + $eventreport->setType($runningtypeShutdown->getID()); try { $eventreportMapper->save($eventreport); } catch(Zend_Exception $e) @@ -1354,4 +1373,8 @@ class EventController extends Zend_Controller_Action } } } + + private function repeatEvent(Application_Model_Event $event) { + switch($event->getR) + } } \ No newline at end of file diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php index a2719bf..14e5e18 100755 --- a/application/forms/EventAdd.php +++ b/application/forms/EventAdd.php @@ -5,6 +5,8 @@ class Application_Form_EventAdd extends Zend_Form private $membershiplist; private $bootoslist; private $poollist; + private $repeattypelist; + private $repeatendlist; private $eventcategorylist; private $start; private $end; @@ -41,6 +43,25 @@ class Application_Form_EventAdd extends Zend_Form return $this->poollist; } + public function setRepeattypelist($repeattypelist){ + $this->repeattypelist = $repeattypelist; + return $this; + + } + + public function getRepeattypelist(){ + return $this->repeattypelist; + } + + public function setRepeatendlist($repeatendlist){ + $this->repeatendlist = $repeatendlist; + return $this; + } + + public function getRepeatendlist(){ + return $this->repeatendlist; + } + public function getEventcategorylist() { return $this->eventcategorylist; @@ -168,50 +189,36 @@ class Application_Form_EventAdd extends Zend_Form 'value'=>array(0,1), )); - $this->addElement('select', 'repeatType', array( - 'multioptions' => array( - 'day' => 'Daily', - 'week' => 'Once a week', - 'week2' => 'Every couple of weeks', - 'month' => 'Every month', - ), - 'required' => false, - 'label' => 'Repeat Type:', - )); + $repeattypefield = $this->createElement('select','repeattype'); + $repeattypefield ->setLabel('Repeat Type:'); - /* - * This is the multiCheckbox to select special days. - * To do: create a css-file... - * - $this->addElement('multiCheckbox', 'repeatDays', array( - 'multiOptions' => array( - 'mon' => 'Monday', - 'tue' => 'Thuestay', - 'wed' => 'Wednesday', - 'thu' => 'Thursday', - 'fri' => 'Friday', - 'sat' => 'Saturday', - 'sun' => 'Sunday', - ), - 'onchange' => '', - 'required' => false, - 'label' => 'Repeat days:', - 'value'=>array(0,1), - )); - */ - + if(count($this->repeattypelist)>0){ + foreach($this->repeattypelist as $type => $t){ + $title = $t->getTitle(); + $id = $t->getID(); + $repeattypefield->addMultiOption($id, $title); + } + } - $this->addElement('select', 'repeatOption', array( - 'multioptions' => array( - 'after' => 'After', - 'date' => 'Date', - ), - 'required' => false, - 'label' => 'Repeat End:', - 'onchange' => 'repeatOptionChanged("repeatOption");', - )); + $repeattypefield->setRegisterInArrayValidator(false); + $this->addElement($repeattypefield); + + $repeatendfield = $this->createElement('select','repeatend'); + $repeatendfield ->setLabel('Repeat End:'); + + if(count($this->$repeatendlist)>0){ + foreach($this->$repeatendlist as $end => $e){ + $title = $e->getTitle(); + $id = $e->getID(); + $repeatendfield->addMultiOption($id, $title); + } + } + + $repeatendfield->setRegisterInArrayValidator(false); + $repeatendfield->setAttrib('onchange', 'repeatendChanged("repeatend");'); + $this->addElement($repeattypefield); - $this->addElement('text', 'repeatEnd', array( + $this->addElement('text', 'repeatdate', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), diff --git a/application/forms/EventEdit.php b/application/forms/EventEdit.php index fcacf9a..300d766 100755 --- a/application/forms/EventEdit.php +++ b/application/forms/EventEdit.php @@ -5,6 +5,8 @@ class Application_Form_EventEdit extends Zend_Form private $membershiplist; private $bootoslist; private $poollist; + private $repeattypelist; + private $repeatendlist; private $eventcategorylist; private $params; @@ -35,6 +37,25 @@ class Application_Form_EventEdit extends Zend_Form return $this->poollist; } + public function setRepeattypelist($repeattypelist){ + $this->repeattypelist = $repeattypelist; + return $this; + + } + + public function getRepeattypelist(){ + return $this->repeattypelist; + } + + public function setRepeatendlist($repeatendlist){ + $this->repeatendlist = $repeatendlist; + return $this; + } + + public function getRepeatendlist(){ + return $this->repeatendlist; + } + public function getEventcategorylist() { return $this->eventcategorylist; @@ -142,66 +163,76 @@ class Application_Form_EventEdit extends Zend_Form )); } - if(isset($this->params['repeatType'])) { - $this->addElement('select', 'repeatType', array( - 'multioptions' => array( - 'day' => 'Daily', - 'week' => 'Once a week', - 'week2' => 'Every couple of weeks', - 'month' => 'Every month', - ), - 'required' => false, - 'value' => $this->params['repeatType'], - 'label' => 'Repeat Type:', - )); - } else { - $this->addElement('select', 'repeatType', array( - 'multioptions' => array( - 'day' => 'Daily', - 'week' => 'Once a week', - 'week2' => 'Every couple of weeks', - 'month' => 'Every month', - ), - 'required' => false, - 'label' => 'Repeat Type:', - )); + $repeattypefield = $this->createElement('select','repeattype'); + $repeattypefield ->setLabel('Repeat Type:'); + + if(count($this->repeattypelist)>0){ + foreach($this->repeattypelist as $type => $t){ + $title = $t->getTitle(); + $id = $t->getID(); + $repeattypefield->addMultiOption($id, $title); + } + } + + $repeattypefield->setRegisterInArrayValidator(false); + if(isset($this->params['repeattype'])) { + $repeattypefield->setValue($this->params['repeattype']); + } + $this->addElement($repeattypefield); + + $repeatendfield = $this->createElement('select','repeatend'); + $repeatendfield ->setLabel('Repeat End:'); + + if(count($this->$repeatendlist)>0){ + foreach($this->$repeatendlist as $end => $e){ + $title = $e->getTitle(); + $id = $e->getID(); + $repeatendfield->addMultiOption($id, $title); + } + } + + $repeatendfield->setRegisterInArrayValidator(false); + $repeatendfield->setAttrib('onchange', 'repeatendChanged("repeatend");'); + if(isset($this->params['repeatend'])) { + $repeatendfield->setValue($this->params['repeatend']); } + $this->addElement($repeattypefield); - if(isset($this->params['repeatOption'])) { - $this->addElement('select', 'repeatOption', array( + if(isset($this->params['repeatend'])) { + $this->addElement('select', 'repeatend', array( 'multioptions' => array( - 'after' => 'After', - 'date' => 'Date', + '1' => 'After', + '2' => 'Date', ), 'required' => false, 'label' => 'Repeat End:', - 'value' => $this->params['repeatOption'], - 'onchange' => 'repeatOptionChanged("repeatOption");', + 'value' => $this->params['repeatend'], + 'onchange' => 'repeatendChanged("repeatend");', )); } else { - $this->addElement('select', 'repeatOption', array( + $this->addElement('select', 'repeatend', array( 'multioptions' => array( - 'after' => 'After', - 'date' => 'Date', + '1' => 'After', + '2' => 'Date', ), 'required' => false, 'label' => 'Repeat End:', - 'onchange' => 'repeatOptionChanged("repeatOption");', + 'onchange' => 'repeatendChanged("repeatend");', )); } - if(isset($this->params['repeatEnd'])) { - $this->addElement('text', 'repeatEnd', array( + if(isset($this->params['repeatdate'])) { + $this->addElement('text', 'repeatdate', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), ), 'required' => false, 'label' => 'Repeat End Date:', - 'value' => $this->params['repeatEnd'], + 'value' => $this->params['repeatdate'], )); } else { - $this->addElement('text', 'repeatEnd', array( + $this->addElement('text', 'repeatdate', array( 'filters' => array('StringTrim'), 'validators' => array( array('StringLength', false, array(0, 16)), diff --git a/application/models/DbTable/Eventtype.php b/application/models/DbTable/Eventtype.php deleted file mode 100755 index 6c54913..0000000 --- a/application/models/DbTable/Eventtype.php +++ /dev/null @@ -1,20 +0,0 @@ -_repeatEnd; + return $this->_repeattype; } - public function setRepeatEnd($_repeatEnd) + public function setRepeattype($_repeattype) { - $this->_repeatEnd = $_repeatEnd; + $this->_repeattype = $__repeattype; + return $this; + } + + + public function getRepeatend() + { + return $this->_repeatend; + } + + public function setRepeatend($_repeatend) + { + $this->_repeatend = $_repeatend; + return $this; + } + + public function getRepeatdate() + { + return $this->_repeatdate; + } + + public function setRepeatdate($_repeatdate) + { + $this->_repeatdate = $_repeatdate; + return $this; + } + + public function getRepeatings() + { + return $this->_repeatings; + } + + public function setRepeatings($_repeatings) + { + $this->_repeatings = $_repeatings; return $this; } diff --git a/application/models/EventMapper.php b/application/models/EventMapper.php index 418bab8..864353c 100755 --- a/application/models/EventMapper.php +++ b/application/models/EventMapper.php @@ -85,7 +85,7 @@ class Application_Model_EventMapper public function save(Application_Model_Event $event) { - $data = array('eventID'=> $event->getID() ,'category'=> $event->getCategory() ,'title'=> $event->getTitle(), 'pbs_membershipID'=> $event->getPbs_membershipID(),'end'=> $event->getEnd() ,'immediate'=> $event->getImmediate() ,'note'=> $event->getNote() ,'participants'=> $event->getParticipants() ,'pbs_bootosID'=> $event->getPbs_bootosID(),'pbs_poolID'=> $event->getPbs_poolID(),'repeat'=> $event->getRepeat(),'repeatEnd'=> $event->getRepeatEnd(),'start'=> $event->getStart(),'pbs_bootmenuID'=> $event->getPbs_bootmenuID(),'pbs_filterID'=> $event->getPbs_filterID(), 'running' => $event->getRunning(), 'runningtype' => $event->getRunningtype(), 'created' => $event->getCreated() ); + $data = array('eventID'=> $event->getID() ,'category'=> $event->getCategory() ,'title'=> $event->getTitle(), 'pbs_membershipID'=> $event->getPbs_membershipID(),'end'=> $event->getEnd() ,'immediate'=> $event->getImmediate() ,'note'=> $event->getNote() ,'participants'=> $event->getParticipants() ,'pbs_bootosID'=> $event->getPbs_bootosID(),'pbs_poolID'=> $event->getPbs_poolID(),'repeat'=> $event->getRepeat(),'repeattype'=> $event->getRepeattype(),'repeatend'=> $event->getRepeatend(),'repeatdate'=> $event->getRepeatdate(),'repeatings'=> $event->getRepeatings(),'start'=> $event->getStart(),'pbs_bootmenuID'=> $event->getPbs_bootmenuID(),'pbs_filterID'=> $event->getPbs_filterID(), 'running' => $event->getRunning(), 'runningtype' => $event->getRunningtype(), 'created' => $event->getCreated() ); if (null === ($id = $event->getID()) ) { unset($data['eventID']); return $this->getDbTable()->insert($data); @@ -130,7 +130,10 @@ class Application_Model_EventMapper ->setPbs_filterID($row->pbs_filterID) ->setPbs_bootmenuID($row->pbs_bootmenuID) ->setRepeat($row->repeat) - ->setRepeatEnd($row->repeatEnd) + ->setRepeattype($row->repeattype) + ->setRepeatend($row->repeatend) + ->setRepeatdate($row->repeatdate) + ->setRepeatings($row->repeatings) ->setStart($row->start) ->setRunning($row->running) ->setCreated($row->created) @@ -159,7 +162,10 @@ class Application_Model_EventMapper ->setPbs_filterID($row->pbs_filterID) ->setPbs_bootmenuID($row->pbs_bootmenuID) ->setRepeat($row->repeat) - ->setRepeatEnd($row->repeatEnd) + ->setRepeattype($row->repeattype) + ->setRepeatend($row->repeatend) + ->setRepeatdate($row->repeatdate) + ->setRepeatings($row->repeatings) ->setStart($row->start) ->setRunning($row->running) ->setCreated($row->created) diff --git a/application/models/Eventtype.php b/application/models/Eventtype.php deleted file mode 100755 index fe21eeb..0000000 --- a/application/models/Eventtype.php +++ /dev/null @@ -1,111 +0,0 @@ -setOptions($options); - } - } - - public function __set($name, $value) - { - $method = 'set' . $name; - if (('mapper' == $name) || !method_exists($this, $method)) { - throw new Exception('Invalid eventtype property'); - } - $this->$method($value); - } - - public function __get($name) - { - $method = 'get' . $name; - if (('mapper' == $name) || !method_exists($this, $method)) { - throw new Exception('Invalid eventtype property'); - } - return $this->$method(); - } - - public function setOptions(array $options) - { - $methods = get_class_methods($this); - foreach ($options as $key => $value) { - $method = 'set' . ucfirst($key); - if (in_array($method, $methods)) { - $this->$method($value); - } - } - return $this; - } - - /** - * Returns current data as associative array using ReflectionClass - * - * @return array Returns associative array containing model data - * If "get"-method not available (our primary keys) the function getID() is called - */ - public function toArray() - { - $reflectionClass = new ReflectionClass($this); - $properties = $reflectionClass->getProperties(); - $result = array(); - foreach ($properties as $property) { - $key = $property->name; - if (substr($key, 0, 1) != '_' && $this->$key !== null) { - $method = 'get' . ucfirst($key); - if ($reflectionClass->hasMethod($method)) { - $result[$key] = $this->$method(); - } else { - $result[$key] = $this->$key; - } - } - elseif(substr($key, 0, 1) == '_' && $this->$key !== null) { - $key = substr($key, 1); - $method = 'get' . ucfirst($key); - if ($reflectionClass->hasMethod($method)) { - $result[$key] = $this->$method(); - }else{ - $result[$key] = $this->getID(); - } - - } - } - return $result; - } - - public function getID() - { - return $this->_eventtypeID; - } - public function setID($_eventtypeID) - { - $this->_eventtypeID = $_eventtypeID; - return $this; - } - - public function getTitle() - { - return $this->_title; - } - - public function setTitle($_title) - { - $this->_title = $_title; - return $this; - } -} - diff --git a/application/models/EventtypeMapper.php b/application/models/EventtypeMapper.php deleted file mode 100755 index 7116975..0000000 --- a/application/models/EventtypeMapper.php +++ /dev/null @@ -1,142 +0,0 @@ - $v){ - if($v != null) - $where2[] = "$k = '$v'"; - else - $where2[] = "$k IS NULL"; - } - $where = implode(" AND " ,$where2); - - try{ - $db = Zend_Db_Table::getDefaultAdapter(); - $select = $this->getDbTable()->select() - ->from($this->_dbTable) - ->where($where); - - if(is_array($order)){ - foreach ($order as $k => $v) - $a[] = "$k $v"; - $select->order($a); - } - - $stmt = $select->query(); - $result = $stmt->fetchAll(); - - if(!$array){ - $entries = array(); - if(count($result) > 0) { - foreach ($result as $row) { - $entry = new Application_Model_Eventtype($row); - $entry->setID($row['eventtypeID']); - $entries[] = $entry; - } - } - return $entries; - }else{ - return $result; - } - - }catch (Zend_Exception $e) { - echo "Error message 2: " . $e->getMessage() . "\n"; - } - } - - public function setDbTable($dbTable) - { - if (is_string($dbTable)) { - $dbTable = new $dbTable(); - } - - if (!$dbTable instanceof Zend_Db_Table_Abstract) { - throw new Exception('Invalid table data gateway provided'); - } - - $this->_dbTable = $dbTable; - - return $this; - } - - public function getDbTable() - { - if (null === $this->_dbTable) { - $this->setDbTable('Application_Model_DbTable_Eventtype'); - } - - return $this->_dbTable; - } - - public function save(Application_Model_Eventtype $eventtype) - { - - $data = array('eventtypeID'=> $eventtype->getID() ,'title'=> $eventtype->getTitle() ); - - if (null === ($id = $eventtype->getID()) ) { - unset($data['eventtypeID']); - $this->getDbTable()->insert($data); - } else { - $this->getDbTable()->update($data, array('eventtypeID = ?' => $id)); - } - } - - public function delete(Application_Model_Eventtype $eventtype) - { - if (null === ($id = $eventtype->getID()) ) { - return; - } else { - $this->getDbTable()->delete(array('eventtypeID = ?' => $id)); - } - } - - public function find($id, Application_Model_Eventtype $eventtype = null) - { - $result = $this->getDbTable()->find($id); - if (0 == count($result)) { - return; - } - - if($eventtype == null) { - $return = true; - } - - $row = $result->current(); - - if($return) { - $eventtype = new Application_Model_Eventtype(); - $eventtype - ->setID($row->eventtypeID) - ->setTitle($row->title); - return $eventtype; - } else { - $eventtype - ->setID($row->eventtypeID) - ->setTitle($row->title); - } - } - - public function fetchAll() - { - $resultSet = $this->getDbTable()->fetchAll(); - $entries = array(); - foreach ($resultSet as $row) { - $entry = new Application_Model_Eventtype(); - - $entry - ->setID($row->eventtypeID) - ->setTitle($row->title); - - $entries[] = $entry; - } - return $entries; - } - - - -} - diff --git a/application/models/Repeatend.php b/application/models/Repeatend.php new file mode 100755 index 0000000..cabff52 --- /dev/null +++ b/application/models/Repeatend.php @@ -0,0 +1,110 @@ +setOptions($options); + } + } + + public function __set($name, $value) + { + $method = 'set' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid repeatend property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid repeatend property'); + } + return $this->$method(); + } + + public function setOptions(array $options) + { + $methods = get_class_methods($this); + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (in_array($method, $methods)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Returns current data as associative array using ReflectionClass + * + * @return array Returns associative array containing model data + * If "get"-method not available (our primary keys) the function getID() is called + */ + public function toArray() + { + $reflectionClass = new ReflectionClass($this); + $properties = $reflectionClass->getProperties(); + $result = array(); + foreach ($properties as $property) { + $key = $property->name; + if (substr($key, 0, 1) != '_' && $this->$key !== null) { + $method = 'get' . ucfirst($key); + if ($reflectionClass->hasMethod($method)) { + $result[$key] = $this->$method(); + } else { + $result[$key] = $this->$key; + } + } + elseif(substr($key, 0, 1) == '_' && $this->$key !== null) { + $key = substr($key, 1); + $method = 'get' . ucfirst($key); + if ($reflectionClass->hasMethod($method)) { + $result[$key] = $this->$method(); + }else{ + $result[$key] = $this->getID(); + } + + } + } + return $result; + } + + public function getID() + { + return $this->_repeatendID; + } + public function setID($_repeatendID) + { + $this->_repeatendID = $_repeatendID; + return $this; + } + + public function getTitle() + { + return $this->_title; + } + + public function setTitle($_title) + { + $this->_title = $_title; + return $this; + } +} \ No newline at end of file diff --git a/application/models/RepeatendMapper.php b/application/models/RepeatendMapper.php new file mode 100755 index 0000000..3af42f2 --- /dev/null +++ b/application/models/RepeatendMapper.php @@ -0,0 +1,138 @@ + $v){ + if($v != null) + $where2[] = "$k = '$v'"; + else + $where2[] = "$k IS NULL"; + } + $where = implode(" AND " ,$where2); + + try{ + $db = Zend_Db_Table::getDefaultAdapter(); + $select = $this->getDbTable()->select() + ->from($this->_dbTable) + ->where($where); + + if(is_array($order)){ + foreach ($order as $k => $v) + $a[] = "$k $v"; + $select->order($a); + } + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + + if(!$array){ + $entries = array(); + if(count($result) > 0) { + foreach ($result as $row) { + $entry = new Application_Model_Repeatend($row); + $entry->setID($row['repeatendID']); + $entries[] = $entry; + } + } + return $entries; + }else{ + return $result; + } + + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + + public function setDbTable($dbTable) + { + if (is_string($dbTable)) { + $dbTable = new $dbTable(); + } + + if (!$dbTable instanceof Zend_Db_Table_Abstract) { + throw new Exception('Invalid table data gateway provided'); + } + + $this->_dbTable = $dbTable; + + return $this; + } + + public function getDbTable() + { + if (null === $this->_dbTable) { + $this->setDbTable('Application_Model_DbTable_Repeatend'); + } + + return $this->_dbTable; + } + + public function save(Application_Model_Repeatend $repeatend) + { + + $data = array('repeatendID'=> $repeatend->getID() ,'title'=> $repeatend->getTitle() ); + + if (null === ($id = $repeatend->getID()) ) { + unset($data['repeatendID']); + $this->getDbTable()->insert($data); + } else { + $this->getDbTable()->update($data, array('repeatendID = ?' => $id)); + } + } + + public function delete(Application_Model_Repeatend $repeatend) + { + if (null === ($id = $repeatend->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('repeatendID = ?' => $id)); + } + } + + public function find($id, Application_Model_Repeatend $repeatend = null) + { + $result = $this->getDbTable()->find($id); + if (0 == count($result)) { + return; + } + + if($repeatend == null) { + $return = true; + } + + $row = $result->current(); + + if($return) { + $repeatend = new Application_Model_Repeatend(); + $repeatend + ->setID($row->repeatendID) + ->setTitle($row->title); + return $repeatend; + } else { + $repeatend + ->setID($row->repeatendID) + ->setTitle($row->title); + } + } + + public function fetchAll() + { + $resultSet = $this->getDbTable()->fetchAll(); + $entries = array(); + foreach ($resultSet as $row) { + $entry = new Application_Model_Repeatend(); + + $entry + ->setID($row->repeatendID) + ->setTitle($row->title); + + $entries[] = $entry; + } + return $entries; + } +} \ No newline at end of file diff --git a/application/models/Repeattype.php b/application/models/Repeattype.php new file mode 100755 index 0000000..43ad949 --- /dev/null +++ b/application/models/Repeattype.php @@ -0,0 +1,110 @@ +setOptions($options); + } + } + + public function __set($name, $value) + { + $method = 'set' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid repeattype property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid repeattype property'); + } + return $this->$method(); + } + + public function setOptions(array $options) + { + $methods = get_class_methods($this); + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (in_array($method, $methods)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Returns current data as associative array using ReflectionClass + * + * @return array Returns associative array containing model data + * If "get"-method not available (our primary keys) the function getID() is called + */ + public function toArray() + { + $reflectionClass = new ReflectionClass($this); + $properties = $reflectionClass->getProperties(); + $result = array(); + foreach ($properties as $property) { + $key = $property->name; + if (substr($key, 0, 1) != '_' && $this->$key !== null) { + $method = 'get' . ucfirst($key); + if ($reflectionClass->hasMethod($method)) { + $result[$key] = $this->$method(); + } else { + $result[$key] = $this->$key; + } + } + elseif(substr($key, 0, 1) == '_' && $this->$key !== null) { + $key = substr($key, 1); + $method = 'get' . ucfirst($key); + if ($reflectionClass->hasMethod($method)) { + $result[$key] = $this->$method(); + }else{ + $result[$key] = $this->getID(); + } + + } + } + return $result; + } + + public function getID() + { + return $this->_repeattypeID; + } + public function setID($_repeattypeID) + { + $this->_repeattypeID = $_repeattypeID; + return $this; + } + + public function getTitle() + { + return $this->_title; + } + + public function setTitle($_title) + { + $this->_title = $_title; + return $this; + } +} \ No newline at end of file diff --git a/application/models/RepeattypeMapper.php b/application/models/RepeattypeMapper.php new file mode 100755 index 0000000..015c4e2 --- /dev/null +++ b/application/models/RepeattypeMapper.php @@ -0,0 +1,138 @@ + $v){ + if($v != null) + $where2[] = "$k = '$v'"; + else + $where2[] = "$k IS NULL"; + } + $where = implode(" AND " ,$where2); + + try{ + $db = Zend_Db_Table::getDefaultAdapter(); + $select = $this->getDbTable()->select() + ->from($this->_dbTable) + ->where($where); + + if(is_array($order)){ + foreach ($order as $k => $v) + $a[] = "$k $v"; + $select->order($a); + } + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + + if(!$array){ + $entries = array(); + if(count($result) > 0) { + foreach ($result as $row) { + $entry = new Application_Model_Repeattype($row); + $entry->setID($row['repeattypeID']); + $entries[] = $entry; + } + } + return $entries; + }else{ + return $result; + } + + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + + public function setDbTable($dbTable) + { + if (is_string($dbTable)) { + $dbTable = new $dbTable(); + } + + if (!$dbTable instanceof Zend_Db_Table_Abstract) { + throw new Exception('Invalid table data gateway provided'); + } + + $this->_dbTable = $dbTable; + + return $this; + } + + public function getDbTable() + { + if (null === $this->_dbTable) { + $this->setDbTable('Application_Model_DbTable_Repeattype'); + } + + return $this->_dbTable; + } + + public function save(Application_Model_Repeattype $repeattype) + { + + $data = array('repeattypeID'=> $repeattype->getID() ,'title'=> $repeattype->getTitle() ); + + if (null === ($id = $repeattype->getID()) ) { + unset($data['repeattypeID']); + $this->getDbTable()->insert($data); + } else { + $this->getDbTable()->update($data, array('repeattypeID = ?' => $id)); + } + } + + public function delete(Application_Model_Repeattype $repeattype) + { + if (null === ($id = $repeattype->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('repeattypeID = ?' => $id)); + } + } + + public function find($id, Application_Model_Repeattype $repeattype = null) + { + $result = $this->getDbTable()->find($id); + if (0 == count($result)) { + return; + } + + if($repeattype == null) { + $return = true; + } + + $row = $result->current(); + + if($return) { + $repeattype = new Application_Model_Repeattype(); + $repeattype + ->setID($row->repeattypeID) + ->setTitle($row->title); + return $repeattype; + } else { + $repeattype + ->setID($row->repeattypeID) + ->setTitle($row->title); + } + } + + public function fetchAll() + { + $resultSet = $this->getDbTable()->fetchAll(); + $entries = array(); + foreach ($resultSet as $row) { + $entry = new Application_Model_Repeattype(); + + $entry + ->setID($row->repeattypeID) + ->setTitle($row->title); + + $entries[] = $entry; + } + return $entries; + } +} \ No newline at end of file diff --git a/application/models/Runningtype.php b/application/models/Runningtype.php new file mode 100755 index 0000000..d08222d --- /dev/null +++ b/application/models/Runningtype.php @@ -0,0 +1,111 @@ +setOptions($options); + } + } + + public function __set($name, $value) + { + $method = 'set' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid runningtype property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid runningtype property'); + } + return $this->$method(); + } + + public function setOptions(array $options) + { + $methods = get_class_methods($this); + foreach ($options as $key => $value) { + $method = 'set' . ucfirst($key); + if (in_array($method, $methods)) { + $this->$method($value); + } + } + return $this; + } + + /** + * Returns current data as associative array using ReflectionClass + * + * @return array Returns associative array containing model data + * If "get"-method not available (our primary keys) the function getID() is called + */ + public function toArray() + { + $reflectionClass = new ReflectionClass($this); + $properties = $reflectionClass->getProperties(); + $result = array(); + foreach ($properties as $property) { + $key = $property->name; + if (substr($key, 0, 1) != '_' && $this->$key !== null) { + $method = 'get' . ucfirst($key); + if ($reflectionClass->hasMethod($method)) { + $result[$key] = $this->$method(); + } else { + $result[$key] = $this->$key; + } + } + elseif(substr($key, 0, 1) == '_' && $this->$key !== null) { + $key = substr($key, 1); + $method = 'get' . ucfirst($key); + if ($reflectionClass->hasMethod($method)) { + $result[$key] = $this->$method(); + }else{ + $result[$key] = $this->getID(); + } + + } + } + return $result; + } + + public function getID() + { + return $this->_runningtypeID; + } + public function setID($_runningtypeID) + { + $this->_runningtypeID = $_runningtypeID; + return $this; + } + + public function getTitle() + { + return $this->_title; + } + + public function setTitle($_title) + { + $this->_title = $_title; + return $this; + } +} + diff --git a/application/models/RunningtypeMapper.php b/application/models/RunningtypeMapper.php new file mode 100755 index 0000000..621405a --- /dev/null +++ b/application/models/RunningtypeMapper.php @@ -0,0 +1,138 @@ + $v){ + if($v != null) + $where2[] = "$k = '$v'"; + else + $where2[] = "$k IS NULL"; + } + $where = implode(" AND " ,$where2); + + try{ + $db = Zend_Db_Table::getDefaultAdapter(); + $select = $this->getDbTable()->select() + ->from($this->_dbTable) + ->where($where); + + if(is_array($order)){ + foreach ($order as $k => $v) + $a[] = "$k $v"; + $select->order($a); + } + + $stmt = $select->query(); + $result = $stmt->fetchAll(); + + if(!$array){ + $entries = array(); + if(count($result) > 0) { + foreach ($result as $row) { + $entry = new Application_Model_Runningtype($row); + $entry->setID($row['runningtypeID']); + $entries[] = $entry; + } + } + return $entries; + }else{ + return $result; + } + + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + + public function setDbTable($dbTable) + { + if (is_string($dbTable)) { + $dbTable = new $dbTable(); + } + + if (!$dbTable instanceof Zend_Db_Table_Abstract) { + throw new Exception('Invalid table data gateway provided'); + } + + $this->_dbTable = $dbTable; + + return $this; + } + + public function getDbTable() + { + if (null === $this->_dbTable) { + $this->setDbTable('Application_Model_DbTable_Runningtype'); + } + + return $this->_dbTable; + } + + public function save(Application_Model_Runningtype $runningtype) + { + + $data = array('runningtypeID'=> $runningtype->getID() ,'title'=> $runningtype->getTitle() ); + + if (null === ($id = $runningtype->getID()) ) { + unset($data['runningtypeID']); + $this->getDbTable()->insert($data); + } else { + $this->getDbTable()->update($data, array('runningtypeID = ?' => $id)); + } + } + + public function delete(Application_Model_Runningtype $runningtype) + { + if (null === ($id = $runningtype->getID()) ) { + return; + } else { + $this->getDbTable()->delete(array('runningtypeID = ?' => $id)); + } + } + + public function find($id, Application_Model_Runningtype $runningtype = null) + { + $result = $this->getDbTable()->find($id); + if (0 == count($result)) { + return; + } + + if($runningtype == null) { + $return = true; + } + + $row = $result->current(); + + if($return) { + $runningtype = new Application_Model_Runningtype(); + $runningtype + ->setID($row->runningtypeID) + ->setTitle($row->title); + return $runningtype; + } else { + $runningtype + ->setID($row->runningtypeID) + ->setTitle($row->title); + } + } + + public function fetchAll() + { + $resultSet = $this->getDbTable()->fetchAll(); + $entries = array(); + foreach ($resultSet as $row) { + $entry = new Application_Model_Runningtype(); + + $entry + ->setID($row->runningtypeID) + ->setTitle($row->title); + + $entries[] = $entry; + } + return $entries; + } +} \ No newline at end of file -- cgit v1.2.3-55-g7522