From 7c8bad89d27b18668622db2a36752653d3f3789c Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sun, 31 Oct 2010 00:33:58 +0000 Subject: Improved initializeAttributes implementations git-svn-id: http://code.elgg.org/elgg/trunk@7159 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggAnnotation.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engine/classes/ElggAnnotation.php') diff --git a/engine/classes/ElggAnnotation.php b/engine/classes/ElggAnnotation.php index cdcfe363f..d99f5fc9a 100644 --- a/engine/classes/ElggAnnotation.php +++ b/engine/classes/ElggAnnotation.php @@ -14,13 +14,19 @@ */ class ElggAnnotation extends ElggExtender { + protected function initializeAttributes() { + parent::initializeAttributes(); + + $this->attributes['type'] = 'annotation'; + } + /** * Construct a new annotation, optionally from a given id value or db object. * * @param mixed $id The annotation ID */ function __construct($id = null) { - $this->attributes = array(); + $this->initializeAttributes(); if (!empty($id)) { if ($id instanceof stdClass) { @@ -35,8 +41,6 @@ class ElggAnnotation extends ElggExtender { foreach ($objarray as $key => $value) { $this->attributes[$key] = $value; } - - $this->attributes['type'] = "annotation"; } } } -- cgit v1.2.3