mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-29 17:49:15 -04:00
Replace protected array and __get() with just class variables. This is faster and tighter.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user