function delete($collection_id)
{
$collection_id = (int) $collection_id;
$params = array('collection_id' => $collection_id);
if (!$this->hooks->trigger('access:collections:deletecollection', 'collection', $params, true)) {
return false;
}
$db = $this->db;
$prefix = $db->prefix;
// Deleting membership doesn't affect result of deleting ACL.
$q = "DELETE FROM {$prefix}access_collection_membership\n\t\t\tWHERE access_collection_id = {$collection_id}";
$db->deleteData($q);
$q = "DELETE FROM {$prefix}access_collections\n\t\t\tWHERE id = {$collection_id}";
$result = $db->deleteData($q);
return (bool) $result;
}