aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metadata.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/metadata.php')
-rw-r--r--engine/lib/metadata.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php
index 9d95cded6..e3a01ee2e 100644
--- a/engine/lib/metadata.php
+++ b/engine/lib/metadata.php
@@ -30,6 +30,8 @@
*/
function __construct($id = null)
{
+ $this->attributes = array();
+
if (!empty($id)) {
if ($id instanceof stdClass)
@@ -47,23 +49,23 @@
}
function __get($name) {
- if (isset($attributes[$name])) {
+ if (isset($this->attributes[$name])) {
// Sanitise value if necessary
if ($name=='value')
{
- switch ($attributes['value_type'])
+ switch ($this->attributes['value_type'])
{
- case 'integer' : return (int)$attributes['value'];
+ case 'integer' : return (int)$this->attributes['value'];
case 'tag' :
case 'text' :
- case 'file' : return sanitise_string($attributes['value']);
+ case 'file' : return sanitise_string($this->attributes['value']);
- default : throw new InstallationException("Type {$attributes['value_type']} is not supported. This indicates an error in your installation, most likely caused by an incomplete upgrade.");
+ default : throw new InstallationException("Type {$this->attributes['value_type']} is not supported. This indicates an error in your installation, most likely caused by an incomplete upgrade.");
}
}
- return $attributes[$name];
+ return $this->attributes[$name];
}
return null;
}