aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggData.php
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-31 00:33:58 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-10-31 00:33:58 +0000
commit7c8bad89d27b18668622db2a36752653d3f3789c (patch)
tree2732b6296a84cb086f7551e3bf7c205daef8312d /engine/classes/ElggData.php
parentd428c6179cb91fa6c6a6ca739081dfbf79a418b0 (diff)
downloadelgg-7c8bad89d27b18668622db2a36752653d3f3789c.tar.gz
elgg-7c8bad89d27b18668622db2a36752653d3f3789c.tar.bz2
Improved initializeAttributes implementations
git-svn-id: http://code.elgg.org/elgg/trunk@7159 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/classes/ElggData.php')
-rw-r--r--engine/classes/ElggData.php28
1 files changed, 27 insertions, 1 deletions
diff --git a/engine/classes/ElggData.php b/engine/classes/ElggData.php
index fbc11881a..e465913ef 100644
--- a/engine/classes/ElggData.php
+++ b/engine/classes/ElggData.php
@@ -15,8 +15,20 @@ abstract class ElggData implements
*/
protected $attributes = array();
+ /**
+ * Initialize the attributes array.
+ *
+ * This is vital to distinguish between metadata and base parameters.
+ *
+ * @return void
+ */
protected function initializeAttributes() {
- $this->attributes['time_created'] = time();
+ // Create attributes array if not already created
+ if (!is_array($this->attributes)) {
+ $this->attributes = array();
+ }
+
+ $this->attributes['time_created'] = '';
}
/**
@@ -27,6 +39,20 @@ abstract class ElggData implements
abstract public function getURL();
/**
+ * Save this data to the appropriate database table.
+ *
+ * @return bool
+ */
+ abstract public function save();
+
+ /**
+ * Delete this data.
+ *
+ * @return bool
+ */
+ abstract public function delete();
+
+ /**
* Return the guid of the entity's owner.
*
* @return int The owner GUID