summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapplication/models/EventcategoryMapper.php17
-rwxr-xr-xapplication/models/EventreportMapper.php30
-rwxr-xr-xapplication/models/RepeatendMapper.php1
-rwxr-xr-xapplication/models/RepeattypeMapper.php1
-rwxr-xr-xapplication/models/RunningtypeMapper.php1
5 files changed, 38 insertions, 12 deletions
diff --git a/application/models/EventcategoryMapper.php b/application/models/EventcategoryMapper.php
index 2a2e069..b70a116 100755
--- a/application/models/EventcategoryMapper.php
+++ b/application/models/EventcategoryMapper.php
@@ -105,6 +105,7 @@ class Application_Model_EventcategoryMapper
public function find($id, Application_Model_Eventcategory $eventcategory = null)
{
+ $return = false;
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
@@ -113,12 +114,20 @@ class Application_Model_EventcategoryMapper
$row = $result->current();
if($eventcategory == null){
- $eventcategory = new Application_Model_Eventcategory();
+ $return = true;
}
- $eventcategory
- ->setID($row->eventcategoryID)
- ->setTitle($row->title);
+ if($return) {
+ $eventcategory = new Application_Model_Eventcategory();
+ $eventcategory
+ ->setID($row->eventcategoryID)
+ ->setTitle($row->title);
+ return $eventcategory;
+ } else {
+ $eventcategory
+ ->setID($row->eventcategoryID)
+ ->setTitle($row->title);
+ }
}
public function fetchAll()
diff --git a/application/models/EventreportMapper.php b/application/models/EventreportMapper.php
index 98651c9..a78ee73 100755
--- a/application/models/EventreportMapper.php
+++ b/application/models/EventreportMapper.php
@@ -104,6 +104,7 @@ class Application_Model_EventreportMapper
public function find($id, Application_Model_Eventreport $eventreport = null)
{
+ $return = false;
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
@@ -112,16 +113,29 @@ class Application_Model_EventreportMapper
$row = $result->current();
if($eventreport == null){
- $eventreport = new Application_Model_Eventreport();
+ $return = true;
+
}
- $eventreport
- ->setID($row->reportID)
- ->setEventID($row->eventID)
- ->setResult($row->result)
- ->setErrors($row->errors)
- ->setCreated($row->created)
- ->setType($row->type);
+ if($return) {
+ $eventreport = new Application_Model_Eventreport();
+ $eventreport
+ ->setID($row->reportID)
+ ->setEventID($row->eventID)
+ ->setResult($row->result)
+ ->setErrors($row->errors)
+ ->setCreated($row->created)
+ ->setType($row->type);
+ return $eventreport;
+ } else {
+ $eventreport
+ ->setID($row->reportID)
+ ->setEventID($row->eventID)
+ ->setResult($row->result)
+ ->setErrors($row->errors)
+ ->setCreated($row->created)
+ ->setType($row->type);
+ }
}
public function fetchAll()
diff --git a/application/models/RepeatendMapper.php b/application/models/RepeatendMapper.php
index 3af42f2..dc7782a 100755
--- a/application/models/RepeatendMapper.php
+++ b/application/models/RepeatendMapper.php
@@ -96,6 +96,7 @@ class Application_Model_RepeatendMapper
public function find($id, Application_Model_Repeatend $repeatend = null)
{
+ $return = false;
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
diff --git a/application/models/RepeattypeMapper.php b/application/models/RepeattypeMapper.php
index 015c4e2..aceb4ce 100755
--- a/application/models/RepeattypeMapper.php
+++ b/application/models/RepeattypeMapper.php
@@ -96,6 +96,7 @@ class Application_Model_RepeattypeMapper
public function find($id, Application_Model_Repeattype $repeattype = null)
{
+ $return = false;
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;
diff --git a/application/models/RunningtypeMapper.php b/application/models/RunningtypeMapper.php
index 621405a..17d18de 100755
--- a/application/models/RunningtypeMapper.php
+++ b/application/models/RunningtypeMapper.php
@@ -96,6 +96,7 @@ class Application_Model_RunningtypeMapper
public function find($id, Application_Model_Runningtype $runningtype = null)
{
+ $return = false;
$result = $this->getDbTable()->find($id);
if (0 == count($result)) {
return;