Deletes a document

@param string $type
@param string|number $id
@param array $parameters
@return array
430979
protected function _delete($type, $id = null, array $parameters = []) {
        return $this->__delete($this->index(), $type, $id, $parameters);
    }
359545
public function getDestroyUrl($id, array $parameters = [])
    {
        array_unshift($parameters, $this->getAlias(), $id);

        return route('admin.model.destroy', $parameters);
    }
55907
public function delete(string $uriPath, callable $handler, array $parameters = []): GroupInterface
    {
        return $this->method('DELETE', $uriPath, $handler, $parameters);
    }
821717
public function getDeleteUrl($id, array $parameters = [])
    {
        array_unshift($parameters, $this->getAlias(), $id);

        return route('admin.model.delete', $parameters);
    }
1301987
public function deleteFieldDefinitionsForType($typeId, $status)
    {
        $q = $this->dbHandler->createDeleteQuery();
        $q->deleteFrom(
            $this->dbHandler->quoteTable('ezcontentclass_attribute')
        )->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $q->bindValue($typeId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($status, null, \PDO::PARAM_INT)
                )
            )
        );

        $q->prepare()->execute();
        $subQuery = $this->connection->createQueryBuilder();
        $subQuery
            ->select('attr.id as ezcontentclass_attribute_id')
            ->from('ezcontentclass_attribute', 'attr')
            ->where('attr.contentclass_id = :typeId')
            ->andWhere('attr.id = ezcontentclass_attribute_ml.contentclass_attribute_id');

        $deleteQuery = $this->connection->createQueryBuilder();
        $deleteQuery
            ->delete('ezcontentclass_attribute_ml')
            ->where(
                sprintf('EXISTS (%s)', $subQuery->getSQL())
            )
            ->andWhere('ezcontentclass_attribute_ml.version = :status')
            ->setParameter('typeId', $typeId, ParameterType::INTEGER)
            ->setParameter('status', $status, ParameterType::INTEGER);

        $deleteQuery->execute();
    }
1363477
public function deleteAction(Request $request, User $loggedUser, $type, $widgetId)
    {
        $this->checkPortfolioToolAccess($loggedUser);

        /** @var \Icap\PortfolioBundle\Repository\Widget\AbstractWidgetRepository $abstractWidgetRepository */
        $abstractWidgetRepository = $this->getDoctrine()->getRepository('IcapPortfolioBundle:Widget\AbstractWidget');

        /** @var \Icap\PortfolioBundle\Entity\Widget\AbstractWidget $widget */
        $widget = $abstractWidgetRepository->findOneByWidgetType($type, $widgetId, $loggedUser);

        $response = new JsonResponse();

        try {
            $this->getWidgetsManager()->deleteDataWidget($widget);
        } catch (\Exception $exception) {
            $response->setStatusCode(Response::HTTP_INTERNAL_SERVER_ERROR);
        }

        return $response;
    }
118927
public function deleteAction($id)
    {
        $documentManager = $this->getDocumentManager();
        $document = $documentManager->find($id);
        $documentManager->remove($document);
        $documentManager->flush();

        return $this->handleView($this->view(null));
    }
744389
public function deleteFieldDefinition($typeId, $status, $fieldDefinitionId)
    {
        $q = $this->dbHandler->createDeleteQuery();
        $q->deleteFrom(
            $this->dbHandler->quoteTable('ezcontentclass_attribute')
        )->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('id'),
                    $q->bindValue($fieldDefinitionId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($status, null, \PDO::PARAM_INT)
                ),
                // @todo FIXME: Actually not needed
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $q->bindValue($typeId, null, \PDO::PARAM_INT)
                )
            )
        );

        $q->prepare()->execute();

        $deleteQuery = $this->connection->createQueryBuilder();
        $deleteQuery
            ->delete('ezcontentclass_attribute_ml')
            ->where('contentclass_attribute_id = :fieldDefinitionId')
            ->andWhere('version = :status')
            ->setParameter('fieldDefinitionId', $fieldDefinitionId, ParameterType::INTEGER)
            ->setParameter('status', $status, ParameterType::INTEGER);

        $deleteQuery->execute();
    }
283644
public function delete($lang, $postType, $id)
    {
        $deleteResult = $this->deletePost($id, $postType);
        if(gettype($deleteResult) == "boolean") {
            if($deleteResult) {
                return $this->response('Post is deleted successfully');
            }
            return $this->response('Post could not be deleted. Please try again later or contact administrator', 500);
        }
        return $deleteResult;
    }
1355641
protected function _create(array $data, $id = null, array $parameters = []) {
        return parent::_create($data, $this->type(), $id, $parameters);
    }
371918
public boolean deleteDocument(String name, String type, String id) throws IOException {
        CloseableHttpClient client = HttpClients.createDefault();
        HttpDelete delete = new HttpDelete(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
        try {
            return client.execute(delete).getStatusLine().getStatusCode() == HttpStatus.SC_OK;
        } finally {
            delete.releaseConnection();
        }
    }
1011846
public function delete($id) {

		$bean = \R::findOne( $this->type, ' id = :id ', [ ':id' => $id ] );
		if ( !$bean ) {
			throw new \Exception('This '.$this->type.' does not exist.');
		}

		// Check for property type specific delete methods
		foreach ( $this->properties as $property ) {

			// Check if specific delete property method exists
			$c = new $property['type'];
			if ( method_exists( $c, 'delete' ) ) {
				$c->delete( $bean, $property );
			}

		}

		\R::trash( $bean );

	}
206600
public function deleteCollection($id, array $options = [])
    {
        $this->setOptions($options);
        $coll = new Collection($this->client, $this->database);
        $coll->setHeaders($this->getHeaders());
        $rs = $coll->delete($id);
        $this->checkResponse($rs);
        unset($rs['_curl_info']);

        return $rs;
    }
1051387
public function findBy($id, array $parameters = [], array $headers = [])
    {
        return $this->getFactory()->create(
            $this->getApi()->findBy($id, $parameters, $headers)
        );
    }
1098094
@DELETE
    @Path("/{id}")
    public Response delete(@PathParam("id") final String id)
            throws IOException {
        return execute(getResourceRequest(RequestTypeEnum.DELETE, RestOperationTypeEnum.DELETE).id(id));
    }
1243103
public function delete($index, $type, $id)
    {
        $request = $this->createRequestInstance(self::DELETE_DOCUMENT, $index, $type);
        $request->setId($id);

        return $this->client->send($request);
    }
198352
public function deleteAllMappingsByType($type, $chunk_size = 25) {
    $ids = $this->queryFactory
      ->get('mapping')
      ->condition('type', $type)
      ->execute();

    if (!$ids) {
      return;
    }

    $chunks = array_chunk($ids, $chunk_size);
    foreach ($chunks as $chunk) {
      $entities = $this->storageMapping->loadMultiple($chunk);
      $this->storageMapping->delete($entities);
    }
  }