| Next revision | Previous revision |
| scriptlog:lib:dao:commentdao [2026/09/26 09:09] – admin admin | scriptlog:lib:dao:commentdao [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= Docblock Metadata ======= | ======= Docblock Metadata ======= |
| |
| ^ Tag ^ Value ^ | ^ Tag ^ Value ^ |
| | ''@category'' | Dao Class | | | ''@category'' | Dao 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 ======= |
| |
| ^ Relation ^ Type ^ Meaning ^ | ^ Relation ^ Type ^ Meaning ^ |
| | extends | [[scriptlog:lib:core:dao|''Dao'']] | parent class/interface | | | extends | [[scriptlog:lib:core:dao|''Dao'']] | parent class/interface | |
| |
| ======= Constants (0) ======= | ======= Constants (0) ======= |
| //None.// | //None.// |
| |
| ======= Properties (0) ======= | ======= Properties (1) ======= |
| |
| //None declared.// | ^ Visibility ^ Type ^ Name ^ Default ^ Line ^ |
| | | ''private'' | ''(untyped)'' | ''$selected'' | | 22 | |
| |
| ======= Methods (18) ======= | ======= Methods (18) ======= |
| |
| ^ Visibility ^ Method ^ Summary ^ Line ^ | ^ Visibility ^ Method ^ Summary ^ Line ^ |
| | public | ''__construct()'' | Constructor | 28 | | | public | ''__construct()'' | Constructor | 28 | |
| | public | ''findComments()'' | Find Comments | 46 | | | public | ''findComments()'' | Find Comments | 46 | |
| | public | ''findApprovedCommentsPaginated()'' | Find approved comments with pagination for API | 85 | | | public | ''findApprovedCommentsPaginated()'' | Find approved comments with pagination for API | 85 | |
| | public | ''countApprovedComments()'' | Count approved comments | 123 | | | public | ''countApprovedComments()'' | Count approved comments | 123 | |
| | public | ''findComment()'' | Find Comment | 149 | | | public | ''findComment()'' | Find Comment | 149 | |
| | public | ''updateComment()'' | Update Comment | 178 | | | public | ''updateComment()'' | Update Comment | 178 | |
| | public | ''deleteComment()'' | DeleteComment | 201 | | | public | ''deleteComment()'' | DeleteComment | 201 | |
| | public | ''anonymizeComment()'' | Anonymize comment by replacing author info | 218 | | | public | ''anonymizeComment()'' | Anonymize comment by replacing author info | 218 | |
| | public | ''anonymizeCommentsByEmail()'' | Anonymize all comments by user email | 241 | | | public | ''anonymizeCommentsByEmail()'' | Anonymize all comments by user email | 241 | |
| | public | ''checkCommentId()'' | CheckCommentId | 267 | | | public | ''checkCommentId()'' | CheckCommentId | 267 | |
| | public | ''dropDownCommentStatement()'' | DropDownCommentStatement | 284 | | | public | ''dropDownCommentStatement()'' | DropDownCommentStatement | 284 | |
| | public | ''totalCommentRecords()'' | TotalCommentRecords | 306 | | | public | ''totalCommentRecords()'' | TotalCommentRecords | 306 | |
| | public | ''countReplies()'' | Count Replies for a Comment | 319 | | | public | ''countReplies()'' | Count Replies for a Comment | 319 | |
| | public | ''findCommentWithPost()'' | Find a single comment with post info (no sanitize required). | 333 | | | public | ''findCommentWithPost()'' | Find a single comment with post info (no sanitize required). | 333 | |
| | public | ''insertCommentApi()'' | Insert a comment with the given data and return the new ID. | 349 | | | public | ''insertCommentApi()'' | Insert a comment with the given data and return the new ID. | 349 | |
| | public | ''updateCommentApi()'' | Update specific comment fields. | 362 | | | public | ''updateCommentApi()'' | Update specific comment fields. | 362 | |
| | public | ''deleteCommentWithReplies()'' | Delete replies for a comment, then the comment itself. | 373 | | | public | ''deleteCommentWithReplies()'' | Delete replies for a comment, then the comment itself. | 373 | |
| | public | ''getPostCommentStatus()'' | Get comment_status for a post. | 385 | | | public | ''getPostCommentStatus()'' | Get comment_status for a post. | 385 | |
| |
| |
| into memory and filtered in PHP). | into memory and filtered in PHP). |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$orderBy'' | ''(untyped)'' | '''ID''' | -- default order By Id | | | ''$orderBy'' | ''(untyped)'' | '''ID''' | -- default order By Id | |
| | ''$email'' | ''(untyped)'' | ''null'' | -- optional comment author email filter | | | ''$email'' | ''(untyped)'' | ''null'' | -- optional comment author email filter | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Find approved comments with pagination for API | Find approved comments with pagination for API |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$limit'' | ''(untyped)'' | //required// | //none// | | | ''$limit'' | ''(untyped)'' | //required// | //none// | |
| | ''$offset'' | ''(untyped)'' | //required// | //none// | | | ''$offset'' | ''(untyped)'' | //required// | //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 |
| Count approved comments | Count approved comments |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | ''null'' | //none// | | | ''$postId'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — integer | **Returns:** ''(none declared)'' — integer |
| Find Comment | Find Comment |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$id'' | ''(untyped)'' | //required// | //none// | | | ''$id'' | ''(untyped)'' | //required// | //none// | |
| | ''$sanitize'' | ''(untyped)'' | //required// | //none// | | | ''$sanitize'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — array | **Returns:** ''(none declared)'' — array |
| Update Comment | Update Comment |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$sanitize'' | ''(untyped)'' | //required// | //none// | | | ''$sanitize'' | ''(untyped)'' | //required// | //none// | |
| | ''$bind'' | ''(untyped)'' | //required// | //none// | | | ''$bind'' | ''(untyped)'' | //required// | //none// | |
| | ''$ID'' | ''(untyped)'' | //required// | //none// | | | ''$ID'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| DeleteComment | DeleteComment |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$id'' | ''(untyped)'' | //required// | //none// | | | ''$id'' | ''(untyped)'' | //required// | //none// | |
| | ''$sanitize'' | ''(untyped)'' | //required// | //none// | | | ''$sanitize'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| Used for GDPR data deletion (Right to be Forgotten) | Used for GDPR data deletion (Right to be Forgotten) |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$commentId'' | ''(untyped)'' | //required// | //none// | | | ''$commentId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| Anonymize all comments by user email | Anonymize all comments by user email |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$email'' | ''(untyped)'' | //required// | //none// | | | ''$email'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — bool | **Returns:** ''(none declared)'' — bool |
| CheckCommentId | CheckCommentId |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$id'' | ''(untyped)'' | //required// | //none// | | | ''$id'' | ''(untyped)'' | //required// | //none// | |
| | ''$sanitize'' | ''(untyped)'' | //required// | //none// | | | ''$sanitize'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — integer|numeric | **Returns:** ''(none declared)'' — integer|numeric |
| DropDownCommentStatement | DropDownCommentStatement |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$selected'' | ''(untyped)'' | '''''' | //none// | | | ''$selected'' | ''(untyped)'' | '''''' | //none// | |
| |
| **Returns:** ''(none declared)'' — mixed | **Returns:** ''(none declared)'' — mixed |
| TotalCommentRecords | TotalCommentRecords |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''(untyped)'' | ''null'' | //none// | | | ''$data'' | ''(untyped)'' | ''null'' | //none// | |
| |
| **Returns:** ''(none declared)'' — numeric|int | **Returns:** ''(none declared)'' — numeric|int |
| 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 |
| Find a single comment with post info (no sanitize required). | Find a single comment with post info (no sanitize required). |
| |
| ^ 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 |
| Insert a comment with the given data and return the new ID. | Insert a comment with the given data and return the new ID. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$data'' | ''array'' | //required// | //none// | | | ''$data'' | ''array'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — int | **Returns:** ''(none declared)'' — int |
| Update specific comment fields. | Update specific comment fields. |
| |
| ^ 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 |
| Delete replies for a comment, then the comment itself. | Delete replies for a comment, then the comment itself. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$commentId'' | ''(untyped)'' | //required// | //none// | | | ''$commentId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — void | **Returns:** ''(none declared)'' — void |
| Get comment_status for a post. | Get comment_status for a post. |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$postId'' | ''(untyped)'' | //required// | //none// | | | ''$postId'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' — string|null | **Returns:** ''(none declared)'' — string|null |
| ======= Imports ======= | ======= Imports ======= |
| |
| ^ Alias ^ Fully-qualified name ^ | ^ Alias ^ Fully-qualified name ^ |
| | ''Dao'' | [[scriptlog:lib:core:dao|''Scriptlog\Core\Dao'']] | | | ''Dao'' | [[scriptlog:lib:core:dao|''Scriptlog\Core\Dao'']] | |
| |
| |