aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 12:05:54 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-08-13 12:05:54 +0000
commita3b07f0ffe9dfdcd39290dee4386f23e7be80b94 (patch)
tree99cec4c308da6db9aca5fa69512c1218188e01d8 /engine/lib
parent88d5e2560875ec72e7b37d895d950869b3f51181 (diff)
downloadelgg-a3b07f0ffe9dfdcd39290dee4386f23e7be80b94.tar.gz
elgg-a3b07f0ffe9dfdcd39290dee4386f23e7be80b94.tar.bz2
Closes #46: Method for activating an entity. No hookup yet.
git-svn-id: https://code.elgg.org/elgg/trunk@1890 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/entities.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index afc8eed3c..fe43832ff 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -632,7 +632,7 @@
protected function load($guid)
{
$row = get_entity_as_row($guid);
-
+
if ($row)
{
// Create the array if necessary - all subclasses should test before creating
@@ -664,6 +664,14 @@
}
/**
+ * Re-enable this entity.
+ */
+ public function enable()
+ {
+ return enable_entity($this->get('guid'));
+ }
+
+ /**
* Delete this entity.
*/
public function delete()
@@ -1467,6 +1475,20 @@
}
/**
+ * Enable an entity again.
+ *
+ * @param int $guid
+ */
+ function enable_entity($guid)
+ {
+ global $CONFIG;
+
+ $guid = (int)$guid;
+ return update_data("UPDATE {$CONFIG->dbprefix}entities set enabled='yes' where guid={$guid}");
+
+ }
+
+ /**
* Delete a given entity.
*
* @param int $guid