]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #2597: Auto-initialize temp_metadata, temp_annotations, and volatile as arrays
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 31 Oct 2010 00:44:41 +0000 (00:44 +0000)
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sun, 31 Oct 2010 00:44:41 +0000 (00:44 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7162 36083f99-b078-4883-b0ff-0f9b5a30f544

engine/classes/ElggEntity.php

index a21e9a05754776451ad2cb943f434aa5e9d7ff0b..7532bd9dd56dd85f5c4a4506c4e901da34b92822 100644 (file)
@@ -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'] = "";