diff options
| author | michael pereira | 2011-03-07 17:54:01 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-07 17:54:01 +0100 |
| commit | f122bafccf6a81b87d982956f615e70ceaecfeb3 (patch) | |
| tree | 98e9960b2fda10f29765d3382d7fd92cfc100f92 /application/models/SessionMapper.php | |
| parent | BootMenuEntries fertig (diff) | |
| parent | dirty hack entfertn durch findBy-Methode (diff) | |
| download | pbs2-f122bafccf6a81b87d982956f615e70ceaecfeb3.tar.gz pbs2-f122bafccf6a81b87d982956f615e70ceaecfeb3.tar.xz pbs2-f122bafccf6a81b87d982956f615e70ceaecfeb3.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/models/SessionMapper.php')
| -rw-r--r-- | application/models/SessionMapper.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/application/models/SessionMapper.php b/application/models/SessionMapper.php index dac5c4e..57b2fdf 100644 --- a/application/models/SessionMapper.php +++ b/application/models/SessionMapper.php @@ -5,6 +5,21 @@ class Application_Model_SessionMapper 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)) { |
