Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:service:commentservice

Differences

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

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:service:commentservice [2026/09/26 09:09] – admin adminscriptlog:lib:service:commentservice [2026/09/26 09:34] (current) – admin admin
Line 10: Line 10:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Service class | +| ''@category'' | Service class | 
-  | ''@author'' | M.Noermoehammad | +| ''@author'' | M.Noermoehammad | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@since'' | Since Release 1.0 |+| ''@since'' | Since Release 1.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
Line 25: Line 25:
 //None.// //None.//
  
-======= Properties (0) =======+======= Properties (11) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''private'' | ''(untyped)'' | ''$comment_id'' |  | 28 | 
 +| ''private'' | ''(untyped)'' | ''$post_id'' |  | 34 | 
 +| ''private'' | ''(untyped)'' | ''$author_name'' |  | 40 | 
 +| ''private'' | ''(untyped)'' | ''$author_ip'' |  | 46 | 
 +| ''private'' | ''(untyped)'' | ''$author_email'' |  | 53 | 
 +| ''private'' | ''(untyped)'' | ''$content'' |  | 59 | 
 +| ''private'' | ''(untyped)'' | ''$status'' |  | 65 | 
 +| ''private'' | ''(untyped)'' | ''$created_at'' |  | 72 | 
 +| ''private'' | ''(untyped)'' | ''$commentDao'' |  | 80 | 
 +| ''private'' | ''(untyped)'' | ''$validator'' |  | 88 | 
 +| ''private'' | ''(untyped)'' | ''$sanitizer'' |  | 95 |
  
 ======= Methods (23) ======= ======= Methods (23) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | (undocumented) | 97 | +| public | ''__construct()'' | (undocumented) | 97 | 
-  | public | ''setCommentId()'' | (undocumented) | 104 | +| public | ''setCommentId()'' | (undocumented) | 104 | 
-  | public | ''setPostId()'' | (undocumented) | 109 | +| public | ''setPostId()'' | (undocumented) | 109 | 
-  | public | ''setAuthorName()'' | (undocumented) | 114 | +| public | ''setAuthorName()'' | (undocumented) | 114 | 
-  | public | ''setAuthorIP()'' | (undocumented) | 119 | +| public | ''setAuthorIP()'' | (undocumented) | 119 | 
-  | public | ''setAuthorEmail()'' | (undocumented) | 124 | +| public | ''setAuthorEmail()'' | (undocumented) | 124 | 
-  | public | ''setCommentContent()'' | (undocumented) | 129 | +| public | ''setCommentContent()'' | (undocumented) | 129 | 
-  | public | ''setCommentStatus()'' | (undocumented) | 134 | +| public | ''setCommentStatus()'' | (undocumented) | 134 | 
-  | public | ''setCommentDate()'' | (undocumented) | 139 | +| public | ''setCommentDate()'' | (undocumented) | 139 | 
-  | public | ''grabComments()'' | (undocumented) | 144 | +| public | ''grabComments()'' | (undocumented) | 144 | 
-  | public | ''grabComment()'' | (undocumented) | 149 | +| public | ''grabComment()'' | (undocumented) | 149 | 
-  | public | ''getApprovedCommentsApi()'' | Get paginated approved comments for API | 164 | +| public | ''getApprovedCommentsApi()'' | Get paginated approved comments for API | 164 | 
-  | public | ''countApprovedCommentsApi()'' | Count approved comments for API | 176 | +| public | ''countApprovedCommentsApi()'' | Count approved comments for API | 176 | 
-  | public | ''modifyComment()'' | (undocumented) | 181 | +| public | ''modifyComment()'' | (undocumented) | 181 | 
-  | public | ''removeComment()'' | Remove Comment | 197 | +| public | ''removeComment()'' | Remove Comment | 197 | 
-  | public | ''commentStatementDropDown()'' | Comment Statement DropDown | 217 | +| public | ''commentStatementDropDown()'' | Comment Statement DropDown | 217 | 
-  | public | ''totalComments()'' | Total Comments recorded | 229 | +| public | ''totalComments()'' | Total Comments recorded | 229 | 
-  | public | ''countReplies()'' | Count Replies for a Comment | 240 | +| public | ''countReplies()'' | Count Replies for a Comment | 240 | 
-  | public | ''getCommentApi()'' | Get a single comment with post info for the API. | 251 | +| public | ''getCommentApi()'' | Get a single comment with post info for the API. | 251 | 
-  | public | ''createCommentApi()'' | Create a comment from raw data for the API. | 262 | +| public | ''createCommentApi()'' | Create a comment from raw data for the API. | 262 | 
-  | public | ''updateCommentApi()'' | Update a comment with raw data for the API. | 274 | +| public | ''updateCommentApi()'' | Update a comment with raw data for the API. | 274 | 
-  | public | ''removeCommentApi()'' | Delete a comment and its replies for the API. | 285 | +| public | ''removeCommentApi()'' | Delete a comment and its replies for the API. | 285 | 
-  | public | ''checkPostAcceptsComments()'' | Check if a post exists and allows comments. | 296 |+| public | ''checkPostAcceptsComments()'' | Check if a post exists and allows comments. | 296 |
  
  
Line 65: Line 76:
 //lines 97–102 (6)// //lines 97–102 (6)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$commentDao'' | [[scriptlog:lib:dao:commentdao|''CommentDao'']] | //required// | //none// | +|  ''$commentDao'' |  [[scriptlog:lib:dao:commentdao|''CommentDao'']] |  //required// |  //none// | 
-  | ''$validator'' | [[scriptlog:lib:core:formvalidator|''FormValidator'']] | //required// | //none// | +|  ''$validator'' |  [[scriptlog:lib:core:formvalidator|''FormValidator'']] |  //required// |  //none// | 
-  | ''$sanitize'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | //none// |+|  ''$sanitize'' |  [[scriptlog:lib:core:sanitize|''Sanitize'']] |  //required// |  //none// |
  
  
Line 79: Line 90:
 //lines 104–107 (4)// //lines 104–107 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$comment_id'' | ''(untyped)'' | //required// | //none// |+|  ''$comment_id'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 93: Line 104:
 //lines 109–112 (4)// //lines 109–112 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$post_id'' | ''(untyped)'' | //required// | //none// |+|  ''$post_id'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 107: Line 118:
 //lines 114–117 (4)// //lines 114–117 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$author_name'' | ''(untyped)'' | //required// | //none// |+|  ''$author_name'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 121: Line 132:
 //lines 119–122 (4)// //lines 119–122 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$author_ip'' | ''(untyped)'' | //required// | //none// |+|  ''$author_ip'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 135: Line 146:
 //lines 124–127 (4)// //lines 124–127 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$author_email'' | ''(untyped)'' | //required// | //none// |+|  ''$author_email'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 149: Line 160:
 //lines 129–132 (4)// //lines 129–132 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$content'' | ''(untyped)'' | //required// | //none// |+|  ''$content'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 163: Line 174:
 //lines 134–137 (4)// //lines 134–137 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$status'' | ''(untyped)'' | //required// | //none// |+|  ''$status'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 177: Line 188:
 //lines 139–142 (4)// //lines 139–142 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$created_at'' | ''(untyped)'' | //required// | //none// |+|  ''$created_at'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 191: Line 202:
 //lines 144–147 (4)// //lines 144–147 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// |+|  ''$orderBy'' |  ''(untyped)'' |  '''ID''' |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 205: Line 216:
 //lines 149–152 (4)// //lines 149–152 (4)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''(untyped)'' | //required// | //none// |+|  ''$id'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 221: Line 232:
 Get paginated approved comments for API Get paginated approved comments for API
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$page'' | ''(untyped)'' | ''1'' | //none// | +|  ''$page'' |  ''(untyped)'' |  ''1'' |  //none// | 
-  | ''$perPage'' | ''(untyped)'' | ''10'' | //none// | +|  ''$perPage'' |  ''(untyped)'' |  ''10'' |  //none// | 
-  | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | +|  ''$sortBy'' |  ''(untyped)'' |  '''ID''' |  //none// | 
-  | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | +|  ''$sortOrder'' |  ''(untyped)'' |  '''DESC''' |  //none// | 
-  | ''$postId'' | ''(untyped)'' | ''null'' | //none// |+|  ''$postId'' |  ''(untyped)'' |  ''null'' |  //none// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 241: Line 252:
 Count approved comments for API Count approved comments for API
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$postId'' | ''(untyped)'' | ''null'' | //none// |+|  ''$postId'' |  ''(untyped)'' |  ''null'' |  //none// |
  
 **Returns:** ''(none declared)'' — integer **Returns:** ''(none declared)'' — integer
Line 285: Line 296:
 Comment Statement DropDown Comment Statement DropDown
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$selected'' | ''(untyped)'' | ''""'' | //none// |+|  ''$selected'' |  ''(untyped)'' |  ''""'' |  //none// |
  
 **Returns:** ''(none declared)'' — string **Returns:** ''(none declared)'' — string
Line 301: Line 312:
 Total Comments recorded Total Comments recorded
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$data'' | ''(untyped)'' | ''null'' | //none// |+|  ''$data'' |  ''(untyped)'' |  ''null'' |  //none// |
  
 **Returns:** ''(none declared)'' — integer **Returns:** ''(none declared)'' — integer
Line 317: Line 328:
 Count Replies for a Comment Count Replies for a Comment
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$commentId'' | ''(untyped)'' | //required// | //none// |+|  ''$commentId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — int **Returns:** ''(none declared)'' — int
Line 333: Line 344:
 Get a single comment with post info for the API. Get a single comment with post info for the API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$commentId'' | ''(untyped)'' | //required// | //none// |+|  ''$commentId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array|false **Returns:** ''(none declared)'' — array|false
Line 349: Line 360:
 Create a comment from raw data for the API. Create a comment from raw data for the API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$data'' | ''array'' | //required// | //none// |+|  ''$data'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — int **Returns:** ''(none declared)'' — int
Line 365: Line 376:
 Update a comment with raw data for the API. Update a comment with raw data for the API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$commentId'' | ''(untyped)'' | //required// | //none// | +|  ''$commentId'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$data'' | ''array'' | //required// | //none// |+|  ''$data'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 382: Line 393:
 Delete a comment and its replies for the API. Delete a comment and its replies for the API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$commentId'' | ''(untyped)'' | //required// | //none// |+|  ''$commentId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 398: Line 409:
 Check if a post exists and allows comments. Check if a post exists and allows comments.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$postId'' | ''(untyped)'' | //required// | //none// |+|  ''$postId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — string|null Returns comment_status value or null if post not found **Returns:** ''(none declared)'' — string|null Returns comment_status value or null if post not found
Line 405: Line 416:
 ======= Imports ======= ======= Imports =======
  
-  ^ Alias ^ Fully-qualified name ^ +^ Alias ^ Fully-qualified name ^ 
-  | ''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'']] |
  
  
scriptlog/lib/service/commentservice.1790413760.txt.gz · Last modified: by admin