aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 3f4166324..e5fe74b7f 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -25,6 +25,26 @@
* Any field not appearing in this will be viewed as a
*/
protected $attributes;
+
+ /**
+ * Initialise the attributes array.
+ * This is vital to distinguish between metadata and base parameters.
+ *
+ * Place your base parameters here.
+ */
+ protected function initialise_attributes()
+ {
+ // Create attributes array if not already created
+ if (!is_array($this->attributes)) $this->attributes = array();
+
+ $this->attributes['guid'] = "";
+ $this->attributes['type'] = "";
+ $this->attributes['subtype'] = "";
+ $this->attributes['owner_guid'] = 0;
+ $this->attributes['access_id'] = 0;
+ $this->attributes['time_created'] = time();
+ $this->attributes['time_updated'] = time();
+ }
/**
* Return the value of a given key.