Elgg\Database\MetadataTable::deleteAll PHP Method

deleteAll() public method

Deletes metadata based on $options.
public deleteAll ( array $options ) : boolean | null
$options array An options array. {@link elgg_get_metadata()}
return boolean | null true on success, false on failure, null if no metadata to delete.
    function deleteAll(array $options)
    {
        if (!_elgg_is_valid_options_for_batch_operation($options, 'metadata')) {
            return false;
        }
        $options['metastring_type'] = 'metadata';
        $result = _elgg_batch_metastring_based_objects($options, 'elgg_batch_delete_callback', false);
        // This moved last in case an object's constructor sets metadata. Currently the batch
        // delete process has to create the entity to delete its metadata. See #5214
        $this->cache->invalidateByOptions($options);
        return $result;
    }