aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index b684ae822..1750f12e1 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -212,18 +212,23 @@ abstract class ElggEntity implements
*/
public function set($name, $value) {
if (array_key_exists($name, $this->attributes)) {
- // Check that we're not trying to change the guid!
- if ((array_key_exists('guid', $this->attributes)) && ($name=='guid')) {
- return false;
+ // Certain properties should not be manually changed!
+ switch ($name) {
+ case 'guid':
+ case 'time_created':
+ case 'time_updated':
+ case 'last_action':
+ return FALSE;
+ break;
+ default:
+ $this->attributes[$name] = $value;
+ break;
}
-
- $this->attributes[$name] = $value;
- }
- else {
+ } else {
return $this->setMetaData($name, $value);
}
- return true;
+ return TRUE;
}
/**