diff options
Diffstat (limited to 'application/models/PoolMapper.php')
| -rw-r--r-- | application/models/PoolMapper.php | 16 |
1 files changed, 15 insertions, 1 deletions
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; } - } |
