summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-08 04:55:39 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-08 04:55:39 +0000
commit8592aad2bb1919b20ef2309adb1fbbd7bbba97da (patch)
treed1accb272da7f24b8bdade56f1c4c73fa22d369d
parent736829490adaecab8aea6ffe7538f07cd358cc82 (diff)
Replace protected array and __get() with just class variables. This is faster and tighter.
-rw-r--r--core/libraries/Menu.php21
1 files changed, 6 insertions, 15 deletions
diff --git a/core/libraries/Menu.php b/core/libraries/Menu.php
index 2ec85963..4695004b 100644
--- a/core/libraries/Menu.php
+++ b/core/libraries/Menu.php
@@ -18,23 +18,14 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
abstract class Menu_Item {
- protected $_data = array();
+ protected $text;
+ protected $type;
+ protected $url;
protected function __construct($type, $text, $url) {
- $this->_data["text"] = $text;
- $this->_data["type"] = $type;
- $this->_data["url"] = $url;
- }
-
- public function __get($key) {
- if (array_key_exists($key, $this->_data)) {
- return $this->_data[$key];
- }
- throw new Exception("@todo UNDEFINED PROPERTY");
- }
-
- public function __set($key, $value) {
- $this->_data[$key] = $value;
+ $this->text = $text;
+ $this->type = $type;
+ $this->url = $url;
}
}