From 8dcde51a354a3308017564a64ef69e794f430974 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 Mar 2011 15:51:56 +0100 Subject: Alle mapper mit findBy(criteria, value) ausgestattet && clients zu pool hinzufügen --- application/models/PoolMapper.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'application/models/PoolMapper.php') diff --git a/application/models/PoolMapper.php b/application/models/PoolMapper.php index be096b7..994a3fd 100644 --- a/application/models/PoolMapper.php +++ b/application/models/PoolMapper.php @@ -5,6 +5,21 @@ class Application_Model_PoolMapper protected $_dbTable; + public function findBy($criteria, $value) + { + try{ + $db = Zend_Db_Table::getDefaultAdapter(); + $select = $this->getDbTable()->select() + ->from($this->_dbTable) + ->where($criteria . ' = ?', $value); + $stmt = $select->query(); + $result = $stmt->fetchAll(); + return $result; + }catch (Zend_Exception $e) { + echo "Error message 2: " . $e->getMessage() . "\n"; + } + } + public function setDbTable($dbTable) { if (is_string($dbTable)) { @@ -83,7 +98,6 @@ class Application_Model_PoolMapper return $entries; } - } -- cgit v1.2.3-55-g7522