diff options
| author | Simon | 2011-04-01 14:10:15 +0200 |
|---|---|---|
| committer | Simon | 2011-04-01 14:10:15 +0200 |
| commit | 8fa0353205b9622b778bcb084732d276fcf6fd5f (patch) | |
| tree | d33688a9d479661f9a33c48d1a864104af44d555 /application/models/BootMenuMapper.php | |
| parent | user-layout geändert, Menü nur wenn rolle ausgewählt wurde (diff) | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-8fa0353205b9622b778bcb084732d276fcf6fd5f.tar.gz pbs2-8fa0353205b9622b778bcb084732d276fcf6fd5f.tar.xz pbs2-8fa0353205b9622b778bcb084732d276fcf6fd5f.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/models/BootMenuMapper.php')
| -rw-r--r-- | application/models/BootMenuMapper.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/application/models/BootMenuMapper.php b/application/models/BootMenuMapper.php index e26a9e1..c8065ec 100644 --- a/application/models/BootMenuMapper.php +++ b/application/models/BootMenuMapper.php @@ -5,7 +5,7 @@ class Application_Model_BootMenuMapper protected $_dbTable; - public function findBy($criteria, $value) + public function findBy($criteria, $value, $array=false) { try{ $db = Zend_Db_Table::getDefaultAdapter(); @@ -14,7 +14,19 @@ class Application_Model_BootMenuMapper ->where($criteria . ' = ?', $value); $stmt = $select->query(); $result = $stmt->fetchAll(); - return $result; + + if(!$array){ + $entries = array(); + foreach ($result as $row) { + $entry = new Application_Model_BootMenu($row); + $entry->setID($row['bootmenuID']); + $entries[] = $entry; + } + return $entries; + }else{ + return $result; + } + }catch (Zend_Exception $e) { echo "Error message 2: " . $e->getMessage() . "\n"; } |
