diff options
author | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-13 16:24:02 +0000 |
---|---|---|
committer | icewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-03-13 16:24:02 +0000 |
commit | 5f3d2a8a257959e875e32c09f09126341b5b3254 (patch) | |
tree | 990527b8bbf1b2703ecfb63d64ab5d454e0df0a2 /engine/lib | |
parent | 20e619b3edb4793a36f04e1a1d24b89cd32af8d0 (diff) | |
download | elgg-5f3d2a8a257959e875e32c09f09126341b5b3254.tar.gz elgg-5f3d2a8a257959e875e32c09f09126341b5b3254.tar.bz2 |
Marcus Povey <marcus@dushka.co.uk>
* Types initialised for first time creation
git-svn-id: https://code.elgg.org/elgg/trunk@205 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/entities.php | 20 |
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. |