From 7512229bcaaf39dc2ca6e9b18770db04a6f800fa Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 27 Jan 2011 17:32:56 +0100 Subject: Getter und Setter für Models gesetzt --- application/models/Config.php | 104 ++++++++++++++++++++++++++++-------------- 1 file changed, 69 insertions(+), 35 deletions(-) (limited to 'application/models/Config.php') diff --git a/application/models/Config.php b/application/models/Config.php index e5263d0..2a2d503 100644 --- a/application/models/Config.php +++ b/application/models/Config.php @@ -2,42 +2,76 @@ class Application_Model_Config { + protected $_configID; + protected $_membershipID; + protected $_shellscript; + 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; - } + { + 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 config property'); + } + $this->$method($value); + } + + public function __get($name) + { + $method = 'get' . $name; + if (('mapper' == $name) || !method_exists($this, $method)) { + throw new Exception('Invalid config 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 get_configID() + { + return $this->_configID; + } + + public function set_configID($_configID) + { + $this->_configID = $_configID; + } + + public function get_membershipID() + { + return $this->_membershipID; + } + + public function set_membershipID($_membershipID) + { + $this->_membershipID = $_membershipID; + } + + public function get_shellscript() + { + return $this->_shellscript; + } + public function set_shellscript($_shellscript) + { + $this->_shellscript = $_shellscript; + } } -- cgit v1.2.3-55-g7522