Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:controller:postsapicontroller

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:controller:postsapicontroller [2026/09/26 09:09] – admin adminscriptlog:lib:controller:postsapicontroller [2026/09/26 09:34] (current) – admin admin
Line 14: Line 14:
 ======= 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) =======
Line 30: Line 30:
 //None.// //None.//
  
-======= Properties (0) =======+======= Properties (7) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''private'' | ''(untyped)'' | ''$postDao'' |  | 39 | 
 +| ''private'' | ''(untyped)'' | ''$postService'' |  | 44 | 
 +| ''private'' | ''(untyped)'' | ''$topicDao'' |  | 49 | 
 +| ''private'' | ''(untyped)'' | ''$commentDao'' |  | 54 | 
 +| ''private'' | ''(untyped)'' | ''$mediaDao'' |  | 59 | 
 +| ''private'' | ''(untyped)'' | ''$sanitizer'' |  | 64 | 
 +| ''private'' | ''(untyped)'' | ''$hateoas'' |  | 69 |
  
 ======= Methods (9) ======= ======= Methods (9) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | Constructor | 83 | +| public | ''__construct()'' | Constructor | 83 | 
-  | private | ''resolve()'' | Resolve an optional constructor dependency. | 106 | +| private | ''resolve()'' | Resolve an optional constructor dependency. | 106 | 
-  | public | ''index()'' | Get all published posts (public endpoint) | 123 | +| public | ''index()'' | Get all published posts (public endpoint) | 123 | 
-  | public | ''show()'' | Get a single post by ID (public endpoint) | 176 | +| public | ''show()'' | Get a single post by ID (public endpoint) | 176 | 
-  | public | ''comments()'' | Get comments for a post (public endpoint) | 237 | +| public | ''comments()'' | Get comments for a post (public endpoint) | 237 | 
-  | public | ''store()'' | Create a new post (requires authentication) | 289 | +| public | ''store()'' | Create a new post (requires authentication) | 289 | 
-  | public | ''update()'' | Update an existing post (requires authentication) | 349 | +| public | ''update()'' | Update an existing post (requires authentication) | 349 | 
-  | public | ''destroy()'' | Delete a post (requires authentication) | 430 | +| public | ''destroy()'' | Delete a post (requires authentication) | 430 | 
-  | private | ''generateSlug()'' | Generate URL-friendly slug | 472 |+| private | ''generateSlug()'' | Generate URL-friendly slug | 472 |
  
  
Line 61: Line 68:
 controller with no arguments; tests pass mocks instead. controller with no arguments; tests pass mocks instead.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$postDao'' | [[scriptlog:lib:dao:postdao|''?PostDao'']] | ''null'' | Data access for posts | +|  ''$postDao'' |  [[scriptlog:lib:dao:postdao|''?PostDao'']] |  ''null'' |  Data access for posts | 
-  | ''$topicDao'' | [[scriptlog:lib:dao:topicdao|''?TopicDao'']] | ''null'' | Data access for topics | +|  ''$topicDao'' |  [[scriptlog:lib:dao:topicdao|''?TopicDao'']] |  ''null'' |  Data access for topics | 
-  | ''$commentDao'' | [[scriptlog:lib:dao:commentdao|''?CommentDao'']] | ''null'' | Data access for comments | +|  ''$commentDao'' |  [[scriptlog:lib:dao:commentdao|''?CommentDao'']] |  ''null'' |  Data access for comments | 
-  | ''$mediaDao'' | [[scriptlog:lib:dao:mediadao|''?MediaDao'']] | ''null'' | Data access for media | +|  ''$mediaDao'' |  [[scriptlog:lib:dao:mediadao|''?MediaDao'']] |  ''null'' |  Data access for media | 
-  | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''?Sanitize'']] | ''null'' | Input sanitizer |+|  ''$sanitizer'' |  [[scriptlog:lib:core:sanitize|''?Sanitize'']] |  ''null'' |  Input sanitizer |
  
  
Line 79: Line 86:
 Resolve an optional constructor dependency. Resolve an optional constructor dependency.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$provided'' | ''(untyped)'' | //required// | Injected instance or null | +|  ''$provided'' |  ''(untyped)'' |  //required// |  Injected instance or null | 
-  | ''$class'' | ''(untyped)'' | //required// | Fallback class name |+|  ''$class'' |  ''(untyped)'' |  //required// |  Fallback class name |
  
 **Returns:** ''(none declared)'' — object **Returns:** ''(none declared)'' — object
Line 98: Line 105:
 GET /api/v1/posts GET /api/v1/posts
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$params'' | ''(untyped)'' | ''[]'' | Query parameters (page, per_page, sort_by, sort_order) |+|  ''$params'' |  ''(untyped)'' |  ''[]'' |  Query parameters (page, per_page, sort_by, sort_order) |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 116: Line 123:
 GET /api/v1/posts/{id} GET /api/v1/posts/{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
Line 134: Line 141:
 GET /api/v1/posts/{id}/comments GET /api/v1/posts/{id}/comments
  
-  ^ 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
Line 152: Line 159:
 POST /api/v1/posts POST /api/v1/posts
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$_params'' | ''(untyped)'' | ''[]'' | //none// |+|  ''$_params'' |  ''(untyped)'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 170: Line 177:
 PUT /api/v1/posts/{id} PUT /api/v1/posts/{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
Line 188: Line 195:
 DELETE /api/v1/posts/{id} DELETE /api/v1/posts/{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
Line 204: Line 211:
 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
Line 211: Line 218:
 ======= 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'']] | 
-  | ''ApiAuth'' | [[scriptlog:lib:core:apiauth|''Scriptlog\Core\ApiAuth'']] | +| ''ApiAuth'' | [[scriptlog:lib:core:apiauth|''Scriptlog\Core\ApiAuth'']] | 
-  | ''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'']] | 
-  | ''MediaDao'' | [[scriptlog:lib:dao:mediadao|''Scriptlog\Dao\MediaDao'']] | +| ''MediaDao'' | [[scriptlog:lib:dao:mediadao|''Scriptlog\Dao\MediaDao'']] | 
-  | ''PostDao'' | [[scriptlog:lib:dao:postdao|''Scriptlog\Dao\PostDao'']] | +| ''PostDao'' | [[scriptlog:lib:dao:postdao|''Scriptlog\Dao\PostDao'']] | 
-  | ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] | +| ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] | 
-  | ''CommentApiDto'' | [[scriptlog:lib:dto:commentapidto|''Scriptlog\Dto\Api\CommentApiDto'']] | +| ''CommentApiDto'' | [[scriptlog:lib:dto:commentapidto|''Scriptlog\Dto\Api\CommentApiDto'']] | 
-  | ''PostApiDto'' | [[scriptlog:lib:dto:postapidto|''Scriptlog\Dto\Api\PostApiDto'']] | +| ''PostApiDto'' | [[scriptlog:lib:dto:postapidto|''Scriptlog\Dto\Api\PostApiDto'']] | 
-  | ''PostService'' | [[scriptlog:lib:service:postservice|''Scriptlog\Service\PostService'']] |+| ''PostService'' | [[scriptlog:lib:service:postservice|''Scriptlog\Service\PostService'']] |
  
  
scriptlog/lib/controller/postsapicontroller.1790413760.txt.gz · Last modified: by admin