summaryrefslogtreecommitdiffstats
path: root/application/models
diff options
context:
space:
mode:
authormichael pereira2011-03-30 17:23:30 +0200
committermichael pereira2011-03-30 17:23:30 +0200
commita29a04821929e737a436b842e519845d0d29da94 (patch)
treea855b6cc3bfbff0399eba5c22a540dcf90932626 /application/models
parentFBGui angepasst (button) (diff)
downloadpbs2-a29a04821929e737a436b842e519845d0d29da94.tar.gz
pbs2-a29a04821929e737a436b842e519845d0d29da94.tar.xz
pbs2-a29a04821929e737a436b842e519845d0d29da94.zip
Bootos & Bootiso
Diffstat (limited to 'application/models')
-rw-r--r--application/models/ConfigMapper.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/application/models/ConfigMapper.php b/application/models/ConfigMapper.php
index 341a3f8..fd6760c 100644
--- a/application/models/ConfigMapper.php
+++ b/application/models/ConfigMapper.php
@@ -5,7 +5,7 @@ class Application_Model_ConfigMapper
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_ConfigMapper
->where($criteria . ' = ?', $value);
$stmt = $select->query();
$result = $stmt->fetchAll();
- return $result;
+
+ if(!$array){
+ $entries = array();
+ foreach ($result as $row) {
+ $entry = new Application_Model_Config($row);
+ $entry->setID($row['configID']);
+ $entries[] = $entry;
+ }
+ return $entries;
+ }else{
+ return $result;
+ }
+
}catch (Zend_Exception $e) {
echo "Error message 2: " . $e->getMessage() . "\n";
}