From dba76f20052963b863b562ce774536367df9def8 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 27 Jan 2009 12:37:17 +0000 Subject: Added container_guid to ElggEntity->save() and update_entity() functions. Fixes #711 git-svn-id: https://code.elgg.org/elgg/trunk@2620 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/entities.php b/engine/lib/entities.php index c86a256d5..05974ec09 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -624,7 +624,8 @@ return update_entity( $this->get('guid'), $this->get('owner_guid'), - $this->get('access_id') + $this->get('access_id'), + $this->get('container_guid') ); } else @@ -1262,15 +1263,18 @@ * * @param int $guid * @param int $owner_guid - * @param int $access_id + * @param int $access_id + * @param int $container_guid */ - function update_entity($guid, $owner_guid, $access_id) + function update_entity($guid, $owner_guid, $access_id, $container_guid = null) { global $CONFIG, $ENTITY_CACHE; $guid = (int)$guid; $owner_guid = (int)$owner_guid; - $access_id = (int)$access_id; + $access_id = (int)$access_id; + $container_guid = (int) $container_guid; + if (is_null($container_guid)) $container_guid = $owner_guid; $time = time(); $entity = get_entity($guid); @@ -1278,7 +1282,7 @@ if ($entity->canEdit()) { if (trigger_elgg_event('update',$entity->type,$entity)) { - $ret = update_data("UPDATE {$CONFIG->dbprefix}entities set owner_guid='$owner_guid', access_id='$access_id', time_updated='$time' WHERE guid=$guid"); + $ret = update_data("UPDATE {$CONFIG->dbprefix}entities set owner_guid='$owner_guid', access_id='$access_id', container_guid='$container_guid', time_updated='$time' WHERE guid=$guid"); // If memcache is available then delete this entry from the cache static $newentity_cache; -- cgit v1.2.3