CoolCMS API

CategorySuggestTrait

Internal `suggest` action of the Api `CategoryPresenter` of a module (Bazaar, Comcat): the category autocomplete of the watchdog. Read-only over the public category tree (name and path), no personal data.

IMPORTANT: deliberately without action*(), so it is reachable only through an internal bridge call; otherwise it would become an external endpoint. Guarded by FrontApiSurfacePolicyTest.

Rate limit per IP (ratelimit.categorySuggest, switch security.rateLimit), the key shared by both modules. Over the limit it returns limited: true and no items (the front signal answers 429).

Requires in the presenter:

  • $this->rateLimit (RateLimit), $this->rateLimitConfig (RateLimitConfig)
  • suggestCategories(CategorySuggestQuery): list<CategorySuggestItem> calling the module manager

Table of Contents

Methods

internalActionSuggest()  : array{items: list>, limited: bool}|ApiPermissionDeniedShape
suggestCategories()  : array<int, CategorySuggestItem>

Methods

On this page

Search results