aboutsummaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-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