aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/objects.php
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-22 14:00:22 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-22 14:00:22 +0000
commit07a6c7e45eb742081cb0587352e6670dad07bce0 (patch)
tree053357cad38474449dedadc35548bdf2a806af02 /engine/lib/objects.php
parent2be0ea00c4f2275bec1fe87f369f5e5d7a0ebea5 (diff)
downloadelgg-07a6c7e45eb742081cb0587352e6670dad07bce0.tar.gz
elgg-07a6c7e45eb742081cb0587352e6670dad07bce0.tar.bz2
Rearranging events: stage 1
git-svn-id: https://code.elgg.org/elgg/trunk@680 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib/objects.php')
-rw-r--r--engine/lib/objects.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index 8d78bddd8..e44a005ff 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -225,8 +225,14 @@
// Insert it
$result = insert_data("INSERT into {$CONFIG->dbprefix}objects_entity (guid, title, description) values ($guid, '$title','$description')");
- if ($result!==false)
- return true;
+ if ($result!==false) {
+ $entity = get_entity($guid);
+ if (trigger_event('create',$entity->type,$entity)) {
+ return true;
+ } else {
+ delete_entity($guid);
+ }
+ }
}
return false;