diff options
| author | Simon | 2011-01-27 16:25:34 +0100 |
|---|---|---|
| committer | Simon | 2011-01-27 16:25:34 +0100 |
| commit | 56d52ed8074385e4ad681db5616c2979ecf674ae (patch) | |
| tree | 2b968ae2300e2cfa077bd466d9be1173eee28ffb /application/models | |
| parent | Models hinzugefügt (diff) | |
| download | pbs2-56d52ed8074385e4ad681db5616c2979ecf674ae.tar.gz pbs2-56d52ed8074385e4ad681db5616c2979ecf674ae.tar.xz pbs2-56d52ed8074385e4ad681db5616c2979ecf674ae.zip | |
erster änderungen an den Models, setter und getter fehlern noch
Diffstat (limited to 'application/models')
23 files changed, 794 insertions, 8 deletions
diff --git a/application/models/BootEntries.php b/application/models/BootEntries.php index 0c7e80c..30562e0 100644 --- a/application/models/BootEntries.php +++ b/application/models/BootEntries.php @@ -2,7 +2,42 @@ class Application_Model_BootEntries { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/BootIso.php b/application/models/BootIso.php index 5d893e7..1ceb71d 100644 --- a/application/models/BootIso.php +++ b/application/models/BootIso.php @@ -2,7 +2,42 @@ class Application_Model_BootIso { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/BootMenu.php b/application/models/BootMenu.php index d0bbff9..7f3e31f 100644 --- a/application/models/BootMenu.php +++ b/application/models/BootMenu.php @@ -2,7 +2,42 @@ class Application_Model_BootMenu { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/BootOs.php b/application/models/BootOs.php index fed80f6..1e19f7c 100644 --- a/application/models/BootOs.php +++ b/application/models/BootOs.php @@ -2,7 +2,42 @@ class Application_Model_BootOs { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Client.php b/application/models/Client.php index 2b29500..d09f7ce 100644 --- a/application/models/Client.php +++ b/application/models/Client.php @@ -2,7 +2,42 @@ class Application_Model_Client { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Config.php b/application/models/Config.php index 5750d71..e5263d0 100644 --- a/application/models/Config.php +++ b/application/models/Config.php @@ -2,7 +2,42 @@ class Application_Model_Config { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Filter.php b/application/models/Filter.php index 4766bed..7ebdf24 100644 --- a/application/models/Filter.php +++ b/application/models/Filter.php @@ -2,7 +2,42 @@ class Application_Model_Filter { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/FilterEntries.php b/application/models/FilterEntries.php new file mode 100644 index 0000000..3dd2a81 --- /dev/null +++ b/application/models/FilterEntries.php @@ -0,0 +1,43 @@ +<?php + +class Application_Model_Filterentries +{ + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } + +} + diff --git a/application/models/FilterType.php b/application/models/FilterType.php index 2d662cf..d22dff9 100644 --- a/application/models/FilterType.php +++ b/application/models/FilterType.php @@ -2,7 +2,42 @@ class Application_Model_FilterType { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Filterentries.php b/application/models/Filterentries.php deleted file mode 100644 index 891909d..0000000 --- a/application/models/Filterentries.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php - -class Application_Model_Filterentries -{ - - -} - diff --git a/application/models/Group.php b/application/models/Group.php new file mode 100644 index 0000000..60fefad --- /dev/null +++ b/application/models/Group.php @@ -0,0 +1,43 @@ +<?php + +class Application_Model_Group +{ + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } + +} + diff --git a/application/models/GroupGroups.php b/application/models/GroupGroups.php index 27bd855..94fe3c5 100644 --- a/application/models/GroupGroups.php +++ b/application/models/GroupGroups.php @@ -2,7 +2,42 @@ class Application_Model_GroupGroups { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/GroupRequest.php b/application/models/GroupRequest.php new file mode 100644 index 0000000..83fc428 --- /dev/null +++ b/application/models/GroupRequest.php @@ -0,0 +1,43 @@ +<?php + +class Application_Model_GroupRequest +{ + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } + +} + diff --git a/application/models/Membership.php b/application/models/Membership.php index 07c7238..46b9a0b 100644 --- a/application/models/Membership.php +++ b/application/models/Membership.php @@ -2,7 +2,42 @@ class Application_Model_Membership { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/MembershipFilters.php b/application/models/MembershipFilters.php index 4a72703..09e9e41 100644 --- a/application/models/MembershipFilters.php +++ b/application/models/MembershipFilters.php @@ -2,7 +2,42 @@ class Application_Model_MembershipFilters { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Person.php b/application/models/Person.php index 738f864..a07133b 100644 --- a/application/models/Person.php +++ b/application/models/Person.php @@ -2,7 +2,42 @@ class Application_Model_Person { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Pool.php b/application/models/Pool.php index 2320fd5..13925d7 100644 --- a/application/models/Pool.php +++ b/application/models/Pool.php @@ -2,7 +2,42 @@ class Application_Model_Pool { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/PoolEntries.php b/application/models/PoolEntries.php index 9b8a8b0..05f6609 100644 --- a/application/models/PoolEntries.php +++ b/application/models/PoolEntries.php @@ -2,7 +2,42 @@ class Application_Model_PoolEntries { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/PoolFilters.php b/application/models/PoolFilters.php index a47cf4c..9d1b658 100644 --- a/application/models/PoolFilters.php +++ b/application/models/PoolFilters.php @@ -2,7 +2,42 @@ class Application_Model_PoolFilters { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Right.php b/application/models/Right.php index 741c71a..a9842b0 100644 --- a/application/models/Right.php +++ b/application/models/Right.php @@ -2,7 +2,42 @@ class Application_Model_Right { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/RightRoles.php b/application/models/RightRoles.php index 4725632..d365781 100644 --- a/application/models/RightRoles.php +++ b/application/models/RightRoles.php @@ -2,7 +2,42 @@ class Application_Model_RightRoles { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Role.php b/application/models/Role.php index e79f4f2..67df23a 100644 --- a/application/models/Role.php +++ b/application/models/Role.php @@ -2,7 +2,42 @@ class Application_Model_Role { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } diff --git a/application/models/Session.php b/application/models/Session.php index 76351d0..8fa9748 100644 --- a/application/models/Session.php +++ b/application/models/Session.php @@ -2,7 +2,42 @@ class Application_Model_Session { + 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 guestbook property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid guestbook 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; + } } |
