function removeUser($user_guid, $collection_id)
{
$collection_id = (int) $collection_id;
$user_guid = (int) $user_guid;
$user = get_user($user_guid);
$collection = $this->get($collection_id);
if (!$user instanceof ElggUser || !$collection) {
return false;
}
$params = array('collection_id' => $collection_id, 'user_guid' => $user_guid);
if (!$this->hooks->trigger('access:collections:remove_user', 'collection', $params, true)) {
return false;
}
$db = $this->db;
$prefix = $db->prefix;
$q = "DELETE FROM {$prefix}access_collection_membership\n\t\t\tWHERE access_collection_id = {$collection_id}\n\t\t\t\tAND user_guid = {$user_guid}";
return (bool) $db->deleteData($q);
}