diff options
| author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-01-27 12:37:17 +0000 | 
|---|---|---|
| committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-01-27 12:37:17 +0000 | 
| commit | dba76f20052963b863b562ce774536367df9def8 (patch) | |
| tree | aaa74124c244eea66113d110ae0f50c8611891e5 /engine/lib/entities.php | |
| parent | c7d054987f60b5e602ce0adcd93e3243607adf7f (diff) | |
| download | elgg-dba76f20052963b863b562ce774536367df9def8.tar.gz elgg-dba76f20052963b863b562ce774536367df9def8.tar.bz2 | |
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
Diffstat (limited to 'engine/lib/entities.php')
| -rw-r--r-- | engine/lib/entities.php | 14 | 
1 files changed, 9 insertions, 5 deletions
| 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; | 
