aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-06 16:24:08 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-03-06 16:24:08 +0000
commit5254adc2f10ba7d18851570e87ed1fbce4649deb (patch)
tree8555d2bc4b7cce8677e816dce270db10e90e0921
parentb389316fdc5f334ed5154b0b5057e81d9e640135 (diff)
downloadelgg-5254adc2f10ba7d18851570e87ed1fbce4649deb.tar.gz
elgg-5254adc2f10ba7d18851570e87ed1fbce4649deb.tar.bz2
Reversed delete procedure on entities, parent now checked first before sub deleted. Any stubs left over will be handled by the garbage collector.
git-svn-id: https://code.elgg.org/elgg/trunk@3119 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/group.php10
-rw-r--r--engine/lib/objects.php6
-rw-r--r--engine/lib/sites.php6
-rw-r--r--engine/lib/users.php8
4 files changed, 14 insertions, 16 deletions
diff --git a/engine/lib/group.php b/engine/lib/group.php
index 05c4f1262..28f6eaa10 100644
--- a/engine/lib/group.php
+++ b/engine/lib/group.php
@@ -261,12 +261,10 @@
*/
public function delete()
{
-
- if (!delete_group_entity($this->get('guid')))
- return false;
-
- return parent::delete();
-
+ if (parent::delete())
+ return delete_group_entity($this->get('guid'));
+
+ return false;
}
diff --git a/engine/lib/objects.php b/engine/lib/objects.php
index c049c51d2..5d986675f 100644
--- a/engine/lib/objects.php
+++ b/engine/lib/objects.php
@@ -128,10 +128,10 @@
*/
public function delete()
{
- if (!delete_object_entity($this->get('guid')))
- return false;
+ if (parent::delete())
+ return delete_object_entity($this->get('guid'));//)
- return parent::delete();
+ return false;
}
/**
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 5fc646c17..037a5f331 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -139,10 +139,10 @@
if ($CONFIG->site->getGUID() == $this->guid)
throw new SecurityException('SecurityException:deletedisablecurrentsite');
- if (!delete_site_entity($this->get('guid')))
- return false;
+ if (parent::delete)
+ return delete_site_entity($this->get('guid'));
- return parent::delete();
+ return false;
}
/**
diff --git a/engine/lib/users.php b/engine/lib/users.php
index bfcea4b72..85be124b2 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -150,11 +150,11 @@
* @return true|false
*/
public function delete()
- {
- if (!delete_user_entity($this->get('guid')))
- return false;
+ {
+ if (parent::delete())
+ return delete_user_entity($this->get('guid'));
- return parent::delete();
+ return false;
}