| Next revision | Previous revision |
| scriptlog:lib:controller:commentsapicontroller [2026/09/26 09:09] – admin admin | scriptlog:lib:controller:commentsapicontroller [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)'' | ''$commentDao'' | | 34 | |
| | | ''private'' | ''(untyped)'' | ''$commentService'' | | 39 | |
| | | ''private'' | ''(untyped)'' | ''$sanitizer'' | | 44 | |
| | | ''private'' | ''(untyped)'' | ''$hateoas'' | | 49 | |
| |
| ======= Methods (7) ======= | ======= Methods (7) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | Constructor | 54 | | | public | ''__construct()'' | Constructor | 54 | |
| | public | ''index()'' | Get all approved comments (public endpoint) | 75 | | | public | ''index()'' | Get all approved comments (public endpoint) | 75 | |
| | public | ''show()'' | Get a single comment by ID (public endpoint) | 130 | | | public | ''show()'' | Get a single comment by ID (public endpoint) | 130 | |
| | public | ''store()'' | Create a new comment (public endpoint - for visitors) | 172 | | | public | ''store()'' | Create a new comment (public endpoint - for visitors) | 172 | |
| | public | ''update()'' | Update a comment (requires authentication) | 247 | | | public | ''update()'' | Update a comment (requires authentication) | 247 | |
| | public | ''destroy()'' | Delete a comment (requires authentication) | 312 | | | public | ''destroy()'' | Delete a comment (requires authentication) | 312 | |
| | private | ''getClientIp()'' | Get client IP address | 353 | | | private | ''getClientIp()'' | Get client IP address | 353 | |
| |
| |
| GET /api/v1/comments | GET /api/v1/comments |
| |
| ^ 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/comments/{id} | GET /api/v1/comments/{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 |
| POST /api/v1/comments | POST /api/v1/comments |
| |
| ^ 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/comments/{id} | PUT /api/v1/comments/{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/comments/{id} | DELETE /api/v1/comments/{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 |
| ======= 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'']] | |
| | ''CommentDao'' | [[scriptlog:lib:dao:commentdao|''Scriptlog\Dao\CommentDao'']] | | | ''CommentDao'' | [[scriptlog:lib:dao:commentdao|''Scriptlog\Dao\CommentDao'']] | |
| | ''CommentApiDto'' | [[scriptlog:lib:dto:commentapidto|''Scriptlog\Dto\Api\CommentApiDto'']] | | | ''CommentApiDto'' | [[scriptlog:lib:dto:commentapidto|''Scriptlog\Dto\Api\CommentApiDto'']] | |
| | ''CommentService'' | [[scriptlog:lib:service:commentservice|''Scriptlog\Service\CommentService'']] | | | ''CommentService'' | [[scriptlog:lib:service:commentservice|''Scriptlog\Service\CommentService'']] | |
| |
| |