Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:core:apihateoas

Differences

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

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:core:apihateoas [2026/09/26 09:09] – admin adminscriptlog:lib:core:apihateoas [2026/09/26 09:34] (current) – admin admin
Line 15: Line 15:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Core Class | +| ''@category'' | Core Class | 
-  | ''@author'' | Blogware Team | +| ''@author'' | Blogware Team | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@since'' | 1.0.0 |+| ''@since'' | 1.0.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
Line 30: Line 30:
 //None.// //None.//
  
-======= Properties (0) =======+======= Properties (2) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''private'' | ''(untyped)'' | ''$baseUrl'' |  | 25 | 
 +| ''private'' | ''(untyped)'' | ''$appUrl'' |  | 30 |
  
 ======= Methods (8) ======= ======= Methods (8) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | Constructor | 37 | +| public | ''__construct()'' | Constructor | 37 | 
-  | public | ''paginationLinks()'' | Generate HATEOAS links for a paginated collection | 53 | +| public | ''paginationLinks()'' | Generate HATEOAS links for a paginated collection | 53 | 
-  | public | ''postLinks()'' | Generate HATEOAS links for a single post resource | 111 | +| public | ''postLinks()'' | Generate HATEOAS links for a single post resource | 111 | 
-  | public | ''categoryLinks()'' | Generate HATEOAS links for a single category resource | 151 | +| public | ''categoryLinks()'' | Generate HATEOAS links for a single category resource | 151 | 
-  | public | ''commentLinks()'' | Generate HATEOAS links for a single comment resource | 191 | +| public | ''commentLinks()'' | Generate HATEOAS links for a single comment resource | 191 | 
-  | public | ''archiveLinks()'' | Generate HATEOAS links for archive resources | 225 | +| public | ''archiveLinks()'' | Generate HATEOAS links for archive resources | 225 | 
-  | public | ''rootLinks()'' | Generate HATEOAS root links (API info) | 263 | +| public | ''rootLinks()'' | Generate HATEOAS root links (API info) | 263 | 
-  | private | ''buildUrl()'' | Build a URL with pagination query parameters | 334 |+| private | ''buildUrl()'' | Build a URL with pagination query parameters | 334 |
  
  
Line 57: Line 59:
 Constructor Constructor
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$baseUrl'' | ''(untyped)'' | ''null'' | API base URL |+|  ''$baseUrl'' |  ''(untyped)'' |  ''null'' |  API base URL |
  
  
Line 71: Line 73:
 Generate HATEOAS links for a paginated collection Generate HATEOAS links for a paginated collection
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$resource'' | ''(untyped)'' | //required// | Resource name (e.g., 'posts', 'categories') | +|  ''$resource'' |  ''(untyped)'' |  //required// |  Resource name (e.g., 'posts', 'categories') | 
-  | ''$currentPage'' | ''(untyped)'' | //required// | Current page number | +|  ''$currentPage'' |  ''(untyped)'' |  //required// |  Current page number | 
-  | ''$perPage'' | ''(untyped)'' | //required// | Items per page | +|  ''$perPage'' |  ''(untyped)'' |  //required// |  Items per page | 
-  | ''$totalItems'' | ''(untyped)'' | //required// | Total number of items | +|  ''$totalItems'' |  ''(untyped)'' |  //required// |  Total number of items | 
-  | ''$extraParams'' | ''(untyped)'' | ''[]'' | Additional query parameters |+|  ''$extraParams'' |  ''(untyped)'' |  ''[]'' |  Additional query parameters |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 91: Line 93:
 Generate HATEOAS links for a single post resource Generate HATEOAS links for a single post resource
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$postId'' | ''(untyped)'' | //required// | Post ID | +|  ''$postId'' |  ''(untyped)'' |  //required// |  Post ID | 
-  | ''$slug'' | ''(untyped)'' | '''''' | Post slug |+|  ''$slug'' |  ''(untyped)'' |  '''''' |  Post slug |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 108: Line 110:
 Generate HATEOAS links for a single category resource Generate HATEOAS links for a single category resource
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$categoryId'' | ''(untyped)'' | //required// | Category ID | +|  ''$categoryId'' |  ''(untyped)'' |  //required// |  Category ID | 
-  | ''$slug'' | ''(untyped)'' | '''''' | Category slug |+|  ''$slug'' |  ''(untyped)'' |  '''''' |  Category slug |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 125: Line 127:
 Generate HATEOAS links for a single comment resource Generate HATEOAS links for a single comment resource
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$commentId'' | ''(untyped)'' | //required// | Comment ID | +|  ''$commentId'' |  ''(untyped)'' |  //required// |  Comment ID | 
-  | ''$postId'' | ''(untyped)'' | ''0'' | Post ID |+|  ''$postId'' |  ''(untyped)'' |  ''0'' |  Post ID |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 142: Line 144:
 Generate HATEOAS links for archive resources Generate HATEOAS links for archive resources
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$year'' | ''(untyped)'' | //required// | Year | +|  ''$year'' |  ''(untyped)'' |  //required// |  Year | 
-  | ''$month'' | ''(untyped)'' | ''null'' | Month (optional) |+|  ''$month'' |  ''(untyped)'' |  ''null'' |  Month (optional) |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 174: Line 176:
 Build a URL with pagination query parameters Build a URL with pagination query parameters
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$resource'' | ''(untyped)'' | //required// | //none// | +|  ''$resource'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$page'' | ''(untyped)'' | //required// | //none// | +|  ''$page'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$perPage'' | ''(untyped)'' | //required// | //none// | +|  ''$perPage'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$extraParams'' | ''(untyped)'' | ''[]'' | //none// |+|  ''$extraParams'' |  ''(untyped)'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — string **Returns:** ''(none declared)'' — string
scriptlog/lib/core/apihateoas.1790413761.txt.gz · Last modified: by admin