Truncate the data collection,
removing all stored documents but keeping all associated mappings.

@param array $options Optional parameters
@return array ids of deleted documents
496193
public function truncate(array $options = [])
    {
        $response = $this->kuzzle->query(
            $this->buildQueryArgs('collection', 'truncate'),
            $this->kuzzle->addHeaders([], $this->headers),
            $options
        );

        return $response['result']['ids'];
    }
1255866
public function delete($options)
    {
        $where = $this->parseWhere($options['where']);
        $bulk = new BulkWrite;
        if (1 == $options['limit']) {
            $deleteOptions = ['limit' => 1];
        } else {
            $deleteOptions = ['limit' => 0];
        }
        $bulk->delete($where, $deleteOptions);
        $this->log('remove', $where, $deleteOptions);
        return $bulk;
    }
745696
public function delete($files, array $options = [])
    {
        collect(array_wrap($options))->each(function ($file) {
            Storage::delete(sprintf('%s/%s', $this->uploadFolder, array_get($file, 'filename')));
        });

        return response()->json('Files deleted', 200);
    }
1216794
public function serialize(Options $options)
    {
        return [
            'id' => $options->getId(),
            'data' => $options->getOptions(),
            'user' => $this->userSerializer->serialize($options->getUser()),
        ];
    }
685116
public function mDeleteDocument($documentIds, array $options = [])
    {
        if (!is_array($documentIds)) {
            throw new InvalidArgumentException('Collection.mDeleteDocument: documents parameter format is invalid (should be an array of document IDs)');
        }

        $data = ['body' => ['ids' => $documentIds]];

        $response = $this->kuzzle->query(
            $this->buildQueryArgs('document', 'mDelete'),
            $this->kuzzle->addHeaders($data, $this->headers),
            $options
        );

        return $response['result'];
    }
1221999
public function truncate(array $options): bool
    {
        $options = array_replace($this->defaultOptions, $options);
        $nItems = [];
        foreach (array_reverse($this->props['items']) as $item) {
            $f = $this->filterItem($item, $options);
            if ($f) {
                if ($f !== self::FILTER_LEFT) {
                    $nItems[] = $item;
                }
                $this->props['items'] = array_reverse($nItems);
                return true;
            }
            $nItems[] = $item;
        }
        return false;
    }
652114
public function delete($key, array $options = []) {
		return function($params) {
			unset($this->_session[$params['key']]);
			return !isset($this->_session[$params['key']]);
		};
	}
1178324
public function delete($index, $type, $id, $options = [])
    {
        return $this->db->delete([$index, $type, $id], $options);
    }
1260852
private function deleteElements(PersistentCollection $coll, array $options)
    {
        $deleteDiff = $coll->getDeleteDiff();

        if (empty($deleteDiff)) {
            return;
        }

        list($propertyPath, $parent) = $this->getPathAndParent($coll);

        $query = array('$unset' => array());

        foreach ($deleteDiff as $key => $document) {
            $query['$unset'][$propertyPath . '.' . $key] = true;
        }

        $this->executeQuery($parent, $query, $options);

        /**
         * @todo This is a hack right now because we don't have a proper way to
         * remove an element from an array by its key. Unsetting the key results
         * in the element being left in the array as null so we have to pull
         * null values.
         */
        $this->executeQuery($parent, array('$pull' => array($propertyPath => null)), $options);
    }
136264
public function delete($conditions = null, $options = [])
    {
        $options = ($options instanceof Structure) ? $options : new Structure($options);

        $this->triggerEvent('onUserBeforeDelete', ['conditions' => &$conditions, 'options' => &$options]);

        try {
            $this->getHandler()->delete($conditions);
        } catch (\Exception $e) {
            $this->triggerEvent('onUserDeleteFailure', [
                'conditions' => $conditions,
                'exception' => $e,
                'options' => $options
            ]);

            return false;
        }

        $this->triggerEvent('onUserAfterDelete', ['conditions' => $conditions, 'options' => $options]);

        return true;
    }
579544
public function addDelete($condition, $options = [])
    {
        $this->document[] = [
            'type' => 'delete',
            'condition' => $this->db->getQueryBuilder()->buildCondition($condition),
            'options' => $options,
        ];
        return $this;
    }
724662
public function invoices(array $options = [])
    {
        if (!isset($this->invoices)) {
            $options['customer_uuid'] = $this->uuid;
            $this->invoices = CustomerInvoices::all($options)->invoices;
        }
        return $this->invoices;
    }
385795
public function getIdNameMap( $options = [] ) {

		$map = parent::getIdNameMap( $options );

		if( isset( $options[ 'default' ] ) && $options[ 'default' ] ) {

			unset( $options[ 'default' ] );

			$map = ArrayHelper::merge( [ '0' => 'Choose Theme' ], $map );
		}

		return $map;
	}
143704
public function clear(array $options = []) {
		$options += ['destroySession' => true];
		$cookieClass = get_called_class();

		return function($params) use ($options, $cookieClass) {
			if ($options['destroySession'] && session_id()) {
				session_destroy();
			}
			if (!isset($_COOKIE[$this->_config['name']])) {
				return true;
			}
			$cookies = array_keys(Set::flatten($_COOKIE[$this->_config['name']]));
			foreach ($cookies as $name) {
				$result = setcookie(
					$cookieClass::keyFormat($name, $this->_config),
					"",
					1,
					$this->_config['path'],
					$this->_config['domain'],
					$this->_config['secure'],
					$this->_config['httponly']
				);
				if (!$result) {
					throw new RuntimeException("There was an error clearing {$cookie} cookie.");
				}
			}
			unset($_COOKIE[$this->_config['name']]);
			return true;
		};
	}
895902
public function drop(array $options = [])
    {
        try {
            $cursor = $this->executeCommand(['drop' => $this->collectionName], $options);
        } catch (MongoDBRuntimeException $e) {
            if ('ns not found' === $e->getMessage()) {
                return ['ok' => 0, 'errmsg' => $e->getMessage()];
            }

            throw $e;
        }

        return $cursor->current();
    }
808857
function delete($url = "",$options = array()){
		if(is_array($url)){
			$options = $url;
			$url = "";
		}
		$options["request_method"] = "DELETE";
		return $this->fetchContent($url,$options);
	}
240893
public static function delete(string $dir, array $options = []) : bool {
		if (is_dir($dir) && !is_link($dir)) {
			$skip_files = [];
			if (!empty($options['skip_files'])) {
				$skip_files = $options['skip_files'];
				$options['only_contents'] = true;
			}
			$skip_files[] = '.';
			$skip_files[] = '..';
			$objects = scandir($dir);
			foreach ($objects as $v) {
				if (!in_array($v, $skip_files)) {
					if (!self::delete($dir . DIRECTORY_SEPARATOR . $v, $options)) return false;
				}
			}
			if (empty($options['only_contents'])) {
				return rmdir($dir);
			} else {
				return true;
			}
		} else if (file_exists($dir)) {
			return unlink($dir);
		} else {
			return false;
		}
	}