From 5f3d2a8a257959e875e32c09f09126341b5b3254 Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 13 Mar 2008 16:24:02 +0000 Subject: Marcus Povey * Types initialised for first time creation git-svn-id: https://code.elgg.org/elgg/trunk@205 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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. -- cgit v1.2.3