diff options
| author | Simon | 2011-03-25 17:51:50 +0100 |
|---|---|---|
| committer | Simon | 2011-03-25 17:51:50 +0100 |
| commit | 28f45e155a12db3b27682e84896b3f6a6b1c794a (patch) | |
| tree | 2238c5a430d5928cb6dddb11f717f8edbfa9d66c /application | |
| parent | Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-28f45e155a12db3b27682e84896b3f6a6b1c794a.tar.gz pbs2-28f45e155a12db3b27682e84896b3f6a6b1c794a.tar.xz pbs2-28f45e155a12db3b27682e84896b3f6a6b1c794a.zip | |
Nicht Benötigte Tabellen, Models, Mapper und Dateien entfernt
Diffstat (limited to 'application')
| -rw-r--r-- | application/models/DbTable/MembershipFilters.php | 10 | ||||
| -rw-r--r-- | application/models/DbTable/PoolFilters.php | 10 | ||||
| -rw-r--r-- | application/models/MembershipFilters.php | 65 | ||||
| -rw-r--r-- | application/models/MembershipFiltersMapper.php | 98 | ||||
| -rw-r--r-- | application/models/PoolFilters.php | 99 | ||||
| -rw-r--r-- | application/models/PoolFiltersMapper.php | 98 |
6 files changed, 0 insertions, 380 deletions
diff --git a/application/models/DbTable/MembershipFilters.php b/application/models/DbTable/MembershipFilters.php deleted file mode 100644 index 59276f6..0000000 --- a/application/models/DbTable/MembershipFilters.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -class Application_Model_DbTable_MembershipFilters extends Zend_Db_Table_Abstract -{ - - protected $_name = 'pbs_membershipfilters'; - - -} - diff --git a/application/models/DbTable/PoolFilters.php b/application/models/DbTable/PoolFilters.php deleted file mode 100644 index 2f6dd4f..0000000 --- a/application/models/DbTable/PoolFilters.php +++ /dev/null @@ -1,10 +0,0 @@ -<?php - -class Application_Model_DbTable_PoolFilters extends Zend_Db_Table_Abstract -{ - - protected $_name = 'pbs_poolfilters'; - - -} - diff --git a/application/models/MembershipFilters.php b/application/models/MembershipFilters.php deleted file mode 100644 index 37add69..0000000 --- a/application/models/MembershipFilters.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -class Application_Model_MembershipFilters -{ - protected $_membershipID; - protected $_filterID; - - public function __construct(array $options = null) - { - if (is_array($options)) { - $this->setOptions($options); - } - } - - public function __set($name, $value) - { - $method = 'set' . $name; - if (('mapper' == $name) || !method_exists($this, $method)) { - throw new Exception('Invalid membershipfilters property'); - } - $this->$method($value); - } - - public function __get($name) - { - $method = 'get' . $name; - if (('mapper' == $name) || !method_exists($this, $method)) { - throw new Exception('Invalid membershipfilters property'); - } - return $this->$method(); - } - - public function setOptions(array $options) - { - $methods = get_class_methods($this); - foreach ($options as $key => $value) { - $method = 'set' . ucfirst($key); - if (in_array($method, $methods)) { - $this->$method($value); - } - } - return $this; - } - - - public function getMembershipID() - { - return $this->_membershipID; - } - public function setMembershipID($_membershipID) - { - $this->_membershipID = $_membershipID; - return $this; - } - public function getFilterID() - { - return $this->_filterID; - } - public function setFilterID($_filterID) - { - $this->_filterID = $_filterID; - return $this; - } -} - diff --git a/application/models/MembershipFiltersMapper.php b/application/models/MembershipFiltersMapper.php deleted file mode 100644 index 353eea1..0000000 --- a/application/models/MembershipFiltersMapper.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -class Application_Model_MembershipFiltersMapper -{ - - 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)) { - $dbTable = new $dbTable(); - } - - if (!$dbTable instanceof Zend_Db_Table_Abstract) { - throw new Exception('Invalid table data gateway provided'); - } - - $this->_dbTable = $dbTable; - - return $this; - } - - public function getDbTable() - { - if (null === $this->_dbTable) { - $this->setDbTable('Application_Model_DbTable_MembershipFilters'); - } - - return $this->_dbTable; - } - - public function save(Application_Model_MembershipFilters $membershipfilters) - { - - $data = array('membershipID'=> $membershipfilters->getMembershipID() ,'filterID'=> $membershipfilters->getFilterID() ); - - if (null === ($id = $membershipfilters->getID()) ) { - unset($data['membershipfiltersID']); - $this->getDbTable()->insert($data); - } else { - $this->getDbTable()->update($data, array('membershipfiltersID = ?' => $id)); - } - } - - public function delete(Application_Model_MembershipFilters $membershipfilters) - { - if (null === ($id = $membershipfilters->getID()) ) { - return; - } else { - $this->getDbTable()->delete(array('membershipfiltersID = ?' => $id)); - } - } - - public function find($id, Application_Model_MembershipFilters $membershipfilters) - { - $result = $this->getDbTable()->find($id); - if (0 == count($result)) { - return; - } - - $row = $result->current(); - - $membershipfilters->setMembershipID($row->membershipID)->setFilterID($row->filterID); - } - - public function fetchAll() - { - $resultSet = $this->getDbTable()->fetchAll(); - $entries = array(); - foreach ($resultSet as $row) { - $entry = new Application_Model_MembershipFilters(); - - $entry->setMembershipID($row->membershipID)->setFilterID($row->filterID); - - $entries[] = $entry; - } - return $entries; - } - - - -} - diff --git a/application/models/PoolFilters.php b/application/models/PoolFilters.php deleted file mode 100644 index 8ce21fc..0000000 --- a/application/models/PoolFilters.php +++ /dev/null @@ -1,99 +0,0 @@ -<?php - -class Application_Model_PoolFilters -{ - protected $_poolID; - protected $_filterID; - - public function __construct(array $options = null) - { - if (is_array($options)) { - $this->setOptions($options); - } - } - - public function __set($name, $value) - { - $method = 'set' . $name; - if (('mapper' == $name) || !method_exists($this, $method)) { - throw new Exception('Invalid poolfilters property'); - } - $this->$method($value); - } - - public function __get($name) - { - $method = 'get' . $name; - if (('mapper' == $name) || !method_exists($this, $method)) { - throw new Exception('Invalid poolfilters property'); - } - return $this->$method(); - } - - public function setOptions(array $options) - { - $methods = get_class_methods($this); - foreach ($options as $key => $value) { - $method = 'set' . ucfirst($key); - if (in_array($method, $methods)) { - $this->$method($value); - } - } - return $this; - } - - - public function getPoolID() - { - return $this->_poolID; - } - public function setPoolID($_poolID) - { - $this->_poolID = $_poolID; - return $this; - } - public function getFilterID() - { - return $this->_filterID; - } - public function setFilterID($_filterID) - { - $this->_filterID = $_filterID; - return $this; - } - /** - * Returns current data as associative array using ReflectionClass - * - * @return array Returns associative array containing model data - * If "get"-method not available (our primary keys) the function getID() is called - */ - public function toArray() - { - $reflectionClass = new ReflectionClass($this); - $properties = $reflectionClass->getProperties(); - $result = array(); - foreach ($properties as $property) { - $key = $property->name; - if (substr($key, 0, 1) != '_' && $this->$key !== null) { - $method = 'get' . ucfirst($key); - if ($reflectionClass->hasMethod($method)) { - $result[$key] = $this->$method(); - } else { - $result[$key] = $this->$key; - } - } - elseif(substr($key, 0, 1) == '_' && $this->$key !== null) { - $key = substr($key, 1); - $method = 'get' . ucfirst($key); - if ($reflectionClass->hasMethod($method)) { - $result[$key] = $this->$method(); - }else{ - $result[$key] = $this->getID(); - } - - } - } - return $result; - } -} - diff --git a/application/models/PoolFiltersMapper.php b/application/models/PoolFiltersMapper.php deleted file mode 100644 index 7cc20bb..0000000 --- a/application/models/PoolFiltersMapper.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php - -class Application_Model_PoolFiltersMapper -{ - - 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)) { - $dbTable = new $dbTable(); - } - - if (!$dbTable instanceof Zend_Db_Table_Abstract) { - throw new Exception('Invalid table data gateway provided'); - } - - $this->_dbTable = $dbTable; - - return $this; - } - - public function getDbTable() - { - if (null === $this->_dbTable) { - $this->setDbTable('Application_Model_DbTable_PoolFilters'); - } - - return $this->_dbTable; - } - - public function save(Application_Model_PoolFilters $polfilters) - { - - $data = array('poolID'=> $polfilters->getPoolID() ,'filterID'=> $polfilters->getFilterID() ); - - if (null === ($id = $polfilters->getID()) ) { - unset($data['polfiltersID']); - $this->getDbTable()->insert($data); - } else { - $this->getDbTable()->update($data, array('polfiltersID = ?' => $id)); - } - } - - public function delete(Application_Model_PoolFilters $polfilters) - { - if (null === ($id = $polfilters->getID()) ) { - return; - } else { - $this->getDbTable()->delete(array('polfiltersID = ?' => $id)); - } - } - - public function find($id, Application_Model_PoolFilters $polfilters) - { - $result = $this->getDbTable()->find($id); - if (0 == count($result)) { - return; - } - - $row = $result->current(); - - $polfilters->setPoolID($row->poolID)->setFilterID($row->filterID); - } - - public function fetchAll() - { - $resultSet = $this->getDbTable()->fetchAll(); - $entries = array(); - foreach ($resultSet as $row) { - $entry = new Application_Model_PoolFilters(); - - $entry->setPoolID($row->poolID)->setFilterID($row->filterID); - - $entries[] = $entry; - } - return $entries; - } - - - -} - |
