diff options
author | michael pereira | 2011-03-30 13:17:49 +0200 |
---|---|---|
committer | michael pereira | 2011-03-30 13:17:49 +0200 |
commit | f1654848b7e19f2ffdc8bd7e295526e1e1106ce8 (patch) | |
tree | a984c4f7401c83eddb42fc7faa9c50231459c472 /application/models | |
parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
download | pbs2-f1654848b7e19f2ffdc8bd7e295526e1e1106ce8.tar.gz pbs2-f1654848b7e19f2ffdc8bd7e295526e1e1106ce8.tar.xz pbs2-f1654848b7e19f2ffdc8bd7e295526e1e1106ce8.zip |
findBy Methode angepasst
Diffstat (limited to 'application/models')
-rw-r--r-- | application/models/BootIsoMapper.php | 19 | ||||
-rw-r--r-- | application/models/BootOsMapper.php | 9 |
2 files changed, 19 insertions, 9 deletions
diff --git a/application/models/BootIsoMapper.php b/application/models/BootIsoMapper.php index 52849b2..c8c4b41 100644 --- a/application/models/BootIsoMapper.php +++ b/application/models/BootIsoMapper.php @@ -5,7 +5,7 @@ class Application_Model_BootIsoMapper protected $_dbTable; - public function findBy($criteria, $value) + public function findBy($criteria, $value, $array=false) { try{ $db = Zend_Db_Table::getDefaultAdapter(); @@ -15,14 +15,17 @@ class Application_Model_BootIsoMapper $stmt = $select->query(); $result = $stmt->fetchAll(); - $entries = array(); - foreach ($result as $row) { - $entry = new Application_Model_BootIso($row); - $entry->setID($row['bootisoID']); - $entries[] = $entry; + if(!$array){ + $entries = array(); + foreach ($result as $row) { + $entry = new Application_Model_BootIso($row); + $entry->setID($row['bootisoID']); + $entries[] = $entry; + } + return $entries; + }else{ + return $result; } - - return $entries; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; diff --git a/application/models/BootOsMapper.php b/application/models/BootOsMapper.php index dda5f68..74fced0 100644 --- a/application/models/BootOsMapper.php +++ b/application/models/BootOsMapper.php @@ -15,7 +15,14 @@ class Application_Model_BootOsMapper $stmt = $select->query(); $result = $stmt->fetchAll(); - return $result; + $entries = array(); + foreach ($result as $row) { + $entry = new Application_Model_BootOs($row); + $entry->setID($row['bootosID']); + $entries[] = $entry; + } + + return $entries; }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; |