summaryrefslogtreecommitdiffstats
path: root/application/models/EventcategoryMapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/models/EventcategoryMapper.php')
-rwxr-xr-xapplication/models/EventcategoryMapper.php17
1 files changed, 13 insertions, 4 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()