| Next revision | Previous revision |
| scriptlog:lib:controller:categoriesapicontroller [2026/09/26 09:09] – admin admin | scriptlog:lib:controller:categoriesapicontroller [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Controller Class | | | ''@category'' | Controller Class | |
| | ''@author'' | Blogware Team | | | ''@author'' | Blogware Team | |
| | ''@license'' | MIT | | | ''@license'' | MIT | |
| | ''@version'' | 1.0 | | | ''@version'' | 1.0 | |
| | ''@since'' | Since Release 1.0 | | | ''@since'' | Since Release 1.0 | |
| |
| ======= Inheritance ======= | ======= Inheritance ======= |
| |
| ^ Relation ^ Type ^ Meaning ^ | ^ Relation ^ Type ^ Meaning ^ |
| | extends | [[scriptlog:lib:controller:apicontroller|''ApiController'']] | parent class/interface | | | extends | [[scriptlog:lib:controller:apicontroller|''ApiController'']] | parent class/interface | |
| |
| ======= Constants (0) ======= | ======= Constants (0) ======= |
| //None.// | //None.// |
| |
| ======= Properties (0) ======= | ======= Properties (4) ======= |
| |
| //None declared.// | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | | ''private'' | ''(untyped)'' | ''$topicDao'' | | 35 | |
| | | ''private'' | ''(untyped)'' | ''$topicService'' | | 40 | |
| | | ''private'' | ''(untyped)'' | ''$sanitizer'' | | 45 | |
| | | ''private'' | ''(untyped)'' | ''$hateoas'' | | 50 | |
| |
| ======= Methods (8) ======= | ======= Methods (8) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | Constructor | 55 | | | public | ''__construct()'' | Constructor | 55 | |
| | public | ''index()'' | Get all categories (public endpoint) | 76 | | | public | ''index()'' | Get all categories (public endpoint) | 76 | |
| | public | ''show()'' | Get a single category by ID (public endpoint) | 118 | | | public | ''show()'' | Get a single category by ID (public endpoint) | 118 | |
| | public | ''posts()'' | Get posts in a category (public endpoint) | 150 | | | public | ''posts()'' | Get posts in a category (public endpoint) | 150 | |
| | public | ''store()'' | Create a new category (requires authentication) | 218 | | | public | ''store()'' | Create a new category (requires authentication) | 218 | |
| | public | ''update()'' | Update an existing category (requires authentication) | 268 | | | public | ''update()'' | Update an existing category (requires authentication) | 268 | |
| | public | ''destroy()'' | Delete a category (requires authentication) | 328 | | | public | ''destroy()'' | Delete a category (requires authentication) | 328 | |
| | private | ''generateSlug()'' | Generate URL-friendly slug | 370 | | | private | ''generateSlug()'' | Generate URL-friendly slug | 370 | |
| |
| |
| GET /api/v1/categories | GET /api/v1/categories |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$params'' | ''(untyped)'' | ''[]'' | Query parameters | | | ''$params'' | ''(untyped)'' | ''[]'' | Query parameters | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| GET /api/v1/categories/{id} | GET /api/v1/categories/{id} |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | | | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| GET /api/v1/categories/{id}/posts | GET /api/v1/categories/{id}/posts |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | | | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| POST /api/v1/categories | POST /api/v1/categories |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$_params'' | ''(untyped)'' | ''[]'' | //none// | | | ''$_params'' | ''(untyped)'' | ''[]'' | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| PUT /api/v1/categories/{id} | PUT /api/v1/categories/{id} |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | | | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| DELETE /api/v1/categories/{id} | DELETE /api/v1/categories/{id} |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | | | ''$params'' | ''(untyped)'' | ''[]'' | Route parameters including 'id' | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Generate URL-friendly slug | Generate URL-friendly slug |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$title'' | ''(untyped)'' | //required// | //none// | | | ''$title'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| ======= Imports ======= | ======= Imports ======= |
| |
| ^ Alias ^ Fully-qualified name ^ | ^ Alias ^ Fully-qualified name ^ |
| | ''ApiController'' | [[scriptlog:lib:controller:apicontroller|''Scriptlog\Controller\ApiController'']] | | | ''ApiController'' | [[scriptlog:lib:controller:apicontroller|''Scriptlog\Controller\ApiController'']] | |
| | ''ApiHateoas'' | [[scriptlog:lib:core:apihateoas|''Scriptlog\Core\ApiHateoas'']] | | | ''ApiHateoas'' | [[scriptlog:lib:core:apihateoas|''Scriptlog\Core\ApiHateoas'']] | |
| | ''ApiResponse'' | [[scriptlog:lib:core:apiresponse|''Scriptlog\Core\ApiResponse'']] | | | ''ApiResponse'' | [[scriptlog:lib:core:apiresponse|''Scriptlog\Core\ApiResponse'']] | |
| | ''FormValidator'' | [[scriptlog:lib:core:formvalidator|''Scriptlog\Core\FormValidator'']] | | | ''FormValidator'' | [[scriptlog:lib:core:formvalidator|''Scriptlog\Core\FormValidator'']] | |
| | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | | | ''Sanitize'' | [[scriptlog:lib:core:sanitize|''Scriptlog\Core\Sanitize'']] | |
| | ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] | | | ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] | |
| | ''PostApiDto'' | [[scriptlog:lib:dto:postapidto|''Scriptlog\Dto\Api\PostApiDto'']] | | | ''PostApiDto'' | [[scriptlog:lib:dto:postapidto|''Scriptlog\Dto\Api\PostApiDto'']] | |
| | ''TopicApiDto'' | [[scriptlog:lib:dto:topicapidto|''Scriptlog\Dto\Api\TopicApiDto'']] | | | ''TopicApiDto'' | [[scriptlog:lib:dto:topicapidto|''Scriptlog\Dto\Api\TopicApiDto'']] | |
| | ''TopicService'' | [[scriptlog:lib:service:topicservice|''Scriptlog\Service\TopicService'']] | | | ''TopicService'' | [[scriptlog:lib:service:topicservice|''Scriptlog\Service\TopicService'']] | |
| |
| |