Deletes a collection.

@param int|string $collectionId
@param int $status
353890
public function deleteCollection($collectionId, ?int $status = null): void
    {
        // Delete all connections between blocks and collections

        $query = $this->connection->createQueryBuilder();
        $query
            ->delete('ngbm_block_collection')
            ->where(
                $query->expr()->eq('collection_id', ':collection_id')
            )
            ->setParameter('collection_id', $collectionId, Type::INTEGER);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status, 'collection_status');
        }

        $query->execute();

        // Then delete the collection itself

        $query = $this->connection->createQueryBuilder();
        $query->delete('ngbm_collection')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $collectionId, Type::INTEGER);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status);
        }

        $query->execute();
    }
567612
public function delete($collectionName, $condition, $options = [])
    {
        $batchOptions = [];
        foreach (['bypassDocumentValidation'] as $name) {
            if (isset($options[$name])) {
                $batchOptions[$name] = $options[$name];
                unset($options[$name]);
            }
        }

        $this->document = [];
        $this->addDelete($condition, $options);
        $result = $this->executeBatch($collectionName, $batchOptions);

        return $result['result'];
    }
627767
protected function setCollectionCollection($collection_id)
    {
        $this->data_collection = $this->collection->get($collection_id);

        if (empty($this->data_collection)) {
            $this->outputHttpStatus(404);
        }
    }
377118
protected static function deleteCollectionByIdAsyncWithHttpInfo($collection_id) 
    {
        $returnType = '';  
        $request = self::deleteCollectionByIdRequest($collection_id); 

        return self::getHttpClient()
            ->sendAsync($request, self::createHttpClientOption())
            ->then(
                function ($response) use ($returnType) {
                    return [null, $response->getStatusCode(), $response->getHeaders()];
                },
                function ($exception) {
                    $response = $exception->getResponse();
                    $statusCode = $response->getStatusCode();
                    throw new ApiException(
                        sprintf(
                            '[%d] Error connecting to the API (%s)',
                            $statusCode,
                            $exception->getRequest()->getUri()
                        ),
                        $statusCode,
                        $response->getHeaders(),
                        $response->getBody()
                    );
                }
            );
    }
1370505
public function delete($boxId, $messageId, $documentId = null)
    {
        $this->doRequest(
            self::RESOURCE_DELETE,
            [
                'boxId' =>  $boxId,
                'messageId' => $messageId,
                'documentId' => $documentId
            ],
            self::METHOD_POST
        );

        return true;
    }
1133928
private function removeFromCollection(&$collection, $items)
    {
        if (is_array($collection)) {
            foreach ($items as $item) {
                foreach ($collection as $index => $v) {
                    if (spl_object_hash($item) == spl_object_hash($v)) {
                        unset($collection[$index]);
                    }
                }
            }
        } else {
            foreach ($items as $item) {
                $collection->removeElement($item);
            }
        }
    }
357571
public function deleteID($ID)
    {
        if($this->offsetExists($this->safeOffset($ID))) {
            $this->offsetUnset($this->safeOffset($ID));
        } else {
            throw new CollectionIDNotFoundException('ID "' . $ID . '" does not exist in collection');
        }
    }
587289
public function delete($contentTypeId, $status)
    {
        if (Type::STATUS_DEFINED === $status && $this->contentTypeGateway->countInstancesOfType($contentTypeId)) {
            throw new BadStateException(
                '$contentTypeId',
                "ContentType with given id still has content instances and therefore can't be deleted"
            );
        }

        $this->contentTypeGateway->delete($contentTypeId, $status);

        // @todo FIXME: Return true only if deletion happened
        return true;
    }
1053103
public function deleteRole($roleId, $status = Role::STATUS_DEFINED)
    {
        try {
            return $this->innerGateway->deleteRole($roleId, $status);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
449847
static function removeCollection( $collectionID )
    {
        if( !is_numeric( $collectionID ) )
        {
            return;
        }

        $db = eZDB::instance();

        $db->query( "DELETE FROM ezinfocollection
                     WHERE id = '$collectionID'" );
        $db->query( "DELETE FROM ezinfocollection_attribute
                     WHERE informationcollection_id = '$collectionID'" );
    }
350153
def resource_collection_delete(self, id, **kwargs):
        ""
        api_path = "/api/v2/resource_collections/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
1089246
function deleteStats(collection) {
      var coverageType;
      for (coverageType in collection) {
        if (collection.hasOwnProperty(coverageType)) {
          if (collection[coverageType].hasOwnProperty("total")) {
            delete collection[coverageType].total;
          }
          if (collection[coverageType].hasOwnProperty("covered")) {
            delete collection[coverageType].covered;
          }
          if (collection[coverageType].hasOwnProperty("skipped")) {
            delete collection[coverageType].skipped;
          }
        }
      }
    }
199184
public function deleteRule($ruleId, ?int $status = null): void
    {
        $query = $this->connection->createQueryBuilder();
        $query->delete('ngbm_rule')
            ->where(
                $query->expr()->eq('id', ':id')
            )
            ->setParameter('id', $ruleId, Type::INTEGER);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status);
        }

        $query->execute();

        if (!$this->ruleExists($ruleId)) {
            $query = $this->connection->createQueryBuilder();
            $query->delete('ngbm_rule_data')
                ->where(
                    $query->expr()->eq('rule_id', ':rule_id')
                )
                ->setParameter('rule_id', $ruleId, Type::INTEGER);

            $query->execute();
        }
    }
723209
public function deleteCollectorRecipient($collectorId, $recipientId)
	{
		return $this->sendRequest(
			$this->createRequest('DELETE', sprintf('collectors/%s/recipients/%s', $collectorId,  $recipientId))
		);
	}
1181601
public function delete($messageId, $documentId = null)
    {
        return $this->diadocApi->delete($this->boxId, $messageId, $documentId);
    }
850116
public function loadCollectionData($collectionId, int $status): array
    {
        $query = $this->getCollectionSelectQuery();
        $query->where(
            $query->expr()->eq('c.id', ':id')
        )
        ->setParameter('id', $collectionId, Type::INTEGER);

        $this->applyStatusCondition($query, $status, 'c.status');

        return $query->execute()->fetchAll(PDO::FETCH_ASSOC);
    }
228600
protected function setCollection($collection_id)
    {
        $this->data_collection = array();

        if (is_numeric($collection_id)) {

            $conditions = array(
                'language' => 'und',
                'collection_id' => $collection_id
            );

            $this->data_collection = $this->collection->get($conditions);

            if (empty($this->data_collection)) {
                $this->outputHttpStatus(404);
            }

            $this->prepareCollection($this->data_collection);
        }
    }