Adds a DELETE route to the collection

@see RouteCollectionBuilder#get()
496515
public function delete($pattern, $handler, array $requirements = [], array $defaults = [])
    {
        $this->addRoute('DELETE', $pattern, $handler, $requirements, $defaults);
    }
73765
private void doMap() throws SearchException, PageException {
	required("collection", action, "collection", collection);
	required("collection", action, "path", path);
	getCollection().map(path);
    }
1146907
public function getRouteCollection()
    {
        foreach ($this->config as $name => $routeConfig) {
            $this->routeCollection->add($name, $this->processRoute($routeConfig));
        }

        unset($this->config);

        return $this->routeCollection;
    }
895342
public function get()
    {
        $hasFrom = ! is_null($this->query->from);

        // When no from has been specified at this point the developer
        // tries to do a basic where query. In this case we want to use the index
        // path, since the index path is supposed to return collections.
        if (! $hasFrom) {
            $path = $this->model->getPath('index');
            $this->query->from($path);
        }

        $models = $this->getModels();

        return $this->model->newCollection($models);
    }
429012
public void get(String path, Route route, ResponseTransformer transformer) {
        addRoute(HttpMethod.get, ResponseTransformerRouteImpl.create(path, route, transformer));
    }
1257864
def delete(self, route: str(), callback: object()):
        
        self.__set_route('delete', {route: callback})
        return RouteMapping
557493
public function deleteCollection()
    {
        // Get dependencies
        $collectionMapper = ($this->container->dataMapper)('CollectionMapper');
        $pageMapper = ($this->container->dataMapper)('PageMapper');
        $pageElementMapper = ($this->container->dataMapper)('PageElementMapper');
        $pageSettingMapper = ($this->container->dataMapper)('PageSettingMapper');

        if (null !== $collectionId = $this->request->getParsedBodyParam('id')) {
            // Get list of pages to delete
            $pages = $pageMapper->findCollectionPagesById($collectionId, false);

            foreach ($pages as $value) {
                $page = $pageMapper->make();
                $page->id = $value->id;
                $pageMapper->delete($page);

                $pageElementMapper->deleteElementsByPageId($value->id);
                $pageSettingMapper->deleteByPageId($value->id);
            }

            // Last, delete collection
            $collection = $collectionMapper->make();
            $collection->id = $collectionId;
            $collectionMapper->delete($collection);
        }

        // Redirect back to show collections
        return $this->redirect('adminCollections');
    }
800923
protected function loadRoutes(): RouteCollection
    {
        $builder = $this->getRouteCollectionBuilder();

        if (\is_callable($this->routeCallback)) {
            call_user_func($this->routeCallback, $builder);
        }

        return $builder->build();
    }
981532
protected final <REQ, RESP> Route delete(RouteAction<Request<REQ>, Response<RESP>> action) {
		return createEntityRoute(HttpMethod.DELETE, "", action, null, null);
	}
1185487
public void delete(String path, Route route) {
        addRoute(HttpMethod.delete, createRouteImpl(path, route));
    }
386868
function route(
    $path = '/', $actions, $method = Router::ANY_METHOD, $name = null, array $filters = [], array $events = []
    )
    {
        if (is_array($path)) {
            foreach ($path as $p) {
                $this->collection[$name ?: count($this->collection)] = (new Route($this->Parser))
                        ->route($p, is_array($actions) ? $actions : [$actions], $method, $name, $filters, $events);
            }
        } else {
            $this->collection[$name ?: count($this->collection)] = (new Route($this->Parser))
                    ->route($path, is_array($actions) ? $actions : [$actions], $method, $name, $filters, $events);
        }

        return $this;
    }
465168
public function beforeDelete()
    {
        if (($url = UrlRule::findOne(['route' => '/system/page/view', 'params' => 'id=' . $this->id])) != null) {
            $url->delete();
        }
        parent::beforeDelete();
    }
254344
function(server, model, options) {
      // TODO: generate multiple DELETE routes at /RESOURCE and at
      // TODO: /RESOURCE/{ownerId}/ASSOCIATION that take a list of Id's as a payload
      try {
        validationHelper.validateModel(model, logger)

        let collectionName = model.collectionDisplayName || model.modelName

        let Log = logger.bind(chalk.blue(collectionName))

        options = options || {}

        if (model.routeOptions.allowRead !== false) {
          this.generateListEndpoint(server, model, options, Log)
          this.generateFindEndpoint(server, model, options, Log)
        }

        if (model.routeOptions.allowCreate !== false) {
          this.generateCreateEndpoint(server, model, options, Log)
        }

        if (model.routeOptions.allowUpdate !== false) {
          this.generateUpdateEndpoint(server, model, options, Log)
        }

        if (model.routeOptions.allowDelete !== false) {
          this.generateDeleteOneEndpoint(server, model, options, Log)
          this.generateDeleteManyEndpoint(server, model, options, Log)
        }

        if (model.routeOptions.associations) {
          for (let associationName in model.routeOptions.associations) {
            let association = model.routeOptions.associations[associationName]

            if (
              association.type === 'MANY_MANY' ||
              association.type === 'ONE_MANY' ||
              association.type === '_MANY'
            ) {
              if (association.allowAdd !== false) {
                this.generateAssociationAddOneEndpoint(
                  server,
                  model,
                  association,
                  options,
                  Log
                )
                this.generateAssociationAddManyEndpoint(
                  server,
                  model,
                  association,
                  options,
                  Log
                )
              }
              if (association.allowRemove !== false) {
                this.generateAssociationRemoveOneEndpoint(
                  server,
                  model,
                  association,
                  options,
                  Log
                )
                this.generateAssociationRemoveManyEndpoint(
                  server,
                  model,
                  association,
                  options,
                  Log
                )
              }

              if (association.allowRead !== false) {
                this.generateAssociationGetAllEndpoint(
                  server,
                  model,
                  association,
                  options,
                  Log
                )
              }
            }
          }
        }

        if (model.routeOptions && model.routeOptions.extraEndpoints) {
          for (let extraEndpointIndex in model.routeOptions.extraEndpoints) {
            let extraEndpointFunction =
              model.routeOptions.extraEndpoints[extraEndpointIndex]

            extraEndpointFunction(server, model, options, Log)
          }
        }
      } catch (error) {
        logger.error('Error:', error)
        throw error
      }
    }
402636
@Override
    public Node get(final String path) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNullOrEmpty(path, "No path was specified");

        // Make a Path
        final ArchivePath realPath = new BasicPath(path);

        // Delegate
        return get(realPath);
    }
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)
300548
public function addCollection(self $collection)
    {
        // we need to remove all routes with the same names first because just replacing them
        // would not place the new route at the end of the merged array
        foreach ($collection->all() as $name => $route) {
            unset($this->routes[$name]);
            $this->routes[$name] = $route;
        }

        foreach ($collection->getResources() as $resource) {
            $this->addResource($resource);
        }
    }
1124703
def get(self, request, *args, **kwargs):
        
        self.object = self.get_object()
        can_delete = True
        protected_objects = []
        collector_message = None
        collector = Collector(using="default")
        try:
            collector.collect([self.object])
        except ProtectedError as e:
            collector_message = (
                "Cannot delete %s because it has relations "
                "that depends on it." % self.object
            )
            protected_objects = e.protected_objects
            can_delete = False

        if can_delete and self.redirect:
            messages.success(request, self.get_success_message(self.object))
            return self.delete(request, *args, **kwargs)

        context = self.get_context_data(
            object=self.object,
            can_delete=can_delete,
            collector_message=collector_message,
            protected_objects=protected_objects,
        )
        return self.render_to_response(context)