From 0c70cbd09644c3c38f3cb1a1857ff8b77607c945 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sun, 31 Oct 2010 00:44:41 +0000 Subject: Refs #2597: Auto-initialize temp_metadata, temp_annotations, and volatile as arrays git-svn-id: http://code.elgg.org/elgg/trunk@7162 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/classes/ElggEntity.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'engine/classes') diff --git a/engine/classes/ElggEntity.php b/engine/classes/ElggEntity.php index a21e9a057..7532bd9dd 100644 --- a/engine/classes/ElggEntity.php +++ b/engine/classes/ElggEntity.php @@ -46,20 +46,19 @@ abstract class ElggEntity extends ElggData implements * Holds metadata until entity is saved. Once the entity is saved, * metadata are written immediately to the database. */ - protected $temp_metadata; + protected $temp_metadata = array(); /** * Holds annotations until entity is saved. Once the entity is saved, * annotations are written immediately to the database. */ - protected $temp_annotations; - + protected $temp_annotations = array(); /** * Volatile data structure for this object, allows for storage of data * in-memory that isn't sync'd back to the metadata table. */ - protected $volatile; + protected $volatile = array(); /** * Initialise the attributes array. @@ -87,16 +86,6 @@ abstract class ElggEntity extends ElggData implements initialise_entity_cache(); - if (!is_array($this->temp_metadata)) { - $this->temp_metadata = array(); - } - if (!is_array($this->temp_annotations)) { - $this->temp_annotations = array(); - } - if (!is_array($this->volatile)) { - $this->volatile = array(); - } - $this->attributes['guid'] = ""; $this->attributes['type'] = ""; $this->attributes['subtype'] = ""; -- cgit v1.2.3