Elgg\Database\AccessCollections::delete PHP Метод

delete() публичный Метод

Deletes a specified access collection and its membership.
public delete ( integer $collection_id ) : boolean
$collection_id integer The collection ID
Результат boolean
    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;
    }