Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:service:topicservice

Differences

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

Link to this comparison view

Next revision
Previous revision
scriptlog:lib:service:topicservice [2026/09/26 09:09] – admin adminscriptlog:lib:service:topicservice [2026/09/26 09:34] (current) – admin admin
Line 12: Line 12:
 ======= 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 27: Line 27:
 //None.// //None.//
  
-======= Properties (0) =======+======= Properties (8) =======
  
-//None declared.//+^ Visibility ^ Type ^ Name ^ Default ^ Line ^ 
 +| ''private'' | ''(untyped)'' | ''$topic_id'' |  | 29 | 
 +| ''private'' | ''(untyped)'' | ''$topic_title'' |  | 36 | 
 +| ''private'' | ''(untyped)'' | ''$topic_slug'' |  | 43 | 
 +| ''private'' | ''(untyped)'' | ''$topic_status'' |  | 50 | 
 +| ''private'' | ''(untyped)'' | ''$topic_locale'' |  | 57 | 
 +| ''private'' | ''(untyped)'' | ''$topicDao'' |  | 65 | 
 +| ''private'' | ''(untyped)'' | ''$validator'' |  | 72 | 
 +| ''private'' | ''(untyped)'' | ''$sanitizer'' |  | 79 |
  
 ======= Methods (22) ======= ======= Methods (22) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public | ''__construct()'' | (undocumented) | 81 | +| public | ''__construct()'' | (undocumented) | 81 | 
-  | public | ''setTopicId()'' | setTopicId | 94 | +| public | ''setTopicId()'' | setTopicId | 94 | 
-  | public | ''setTopicTitle()'' | setTopicTitle | 105 | +| public | ''setTopicTitle()'' | setTopicTitle | 105 | 
-  | public | ''setTopicSlug()'' | setTopicSlug | 116 | +| public | ''setTopicSlug()'' | setTopicSlug | 116 | 
-  | public | ''setTopicStatus()'' | setTopicStatus | 127 | +| public | ''setTopicStatus()'' | setTopicStatus | 127 | 
-  | public | ''setTopicLocale()'' | setTopicLocale | 138 | +| public | ''setTopicLocale()'' | setTopicLocale | 138 | 
-  | public | ''grabTopics()'' | grabTopics | 149 | +| public | ''grabTopics()'' | grabTopics | 149 | 
-  | public | ''grabTopic()'' | grabTopic | 160 | +| public | ''grabTopic()'' | grabTopic | 160 | 
-  | public | ''getActiveTopicsApi()'' | Get paginated active topics for API | 174 | +| public | ''getActiveTopicsApi()'' | Get paginated active topics for API | 174 | 
-  | public | ''countActiveTopicsApi()'' | Count active topics for API | 185 | +| public | ''countActiveTopicsApi()'' | Count active topics for API | 185 | 
-  | public | ''getTopicApi()'' | Get a single topic with post count for API | 196 | +| public | ''getTopicApi()'' | Get a single topic with post count for API | 196 | 
-  | public | ''getPostsByTopicApi()'' | Get paginated posts by topic for API | 211 | +| public | ''getPostsByTopicApi()'' | Get paginated posts by topic for API | 211 | 
-  | public | ''countPostsByTopicApi()'' | Count published posts by topic for API | 223 | +| public | ''countPostsByTopicApi()'' | Count published posts by topic for API | 223 | 
-  | public | ''addTopic()'' | addTopic | 232 | +| public | ''addTopic()'' | addTopic | 232 | 
-  | public | ''modifyTopic()'' | modifyTopic | 247 | +| public | ''modifyTopic()'' | modifyTopic | 247 | 
-  | public | ''removeTopic()'' | removeTopic | 264 | +| public | ''removeTopic()'' | removeTopic | 264 | 
-  | public | ''totalTopics()'' | totalTopics | 283 | +| public | ''totalTopics()'' | totalTopics | 283 | 
-  | public | ''localeDropDown()'' | localeDropDown | 295 | +| public | ''localeDropDown()'' | localeDropDown | 295 | 
-  | public | ''checkTopicSlugExists()'' | Check if a topic slug already exists. | 306 | +| public | ''checkTopicSlugExists()'' | Check if a topic slug already exists. | 306 | 
-  | public | ''createTopicApi()'' | Create a topic from raw data for the API. | 317 | +| public | ''createTopicApi()'' | Create a topic from raw data for the API. | 317 | 
-  | public | ''updateTopicApi()'' | Update a topic with raw data for the API. | 329 | +| public | ''updateTopicApi()'' | Update a topic with raw data for the API. | 329 | 
-  | public | ''removeTopicApi()'' | Delete a topic and its relationships for the API. | 340 |+| public | ''removeTopicApi()'' | Delete a topic and its relationships for the API. | 340 |
  
  
Line 66: Line 74:
 //lines 81–86 (6)// //lines 81–86 (6)//
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topicDao'' | [[scriptlog:lib:dao:topicdao|''TopicDao'']] | //required// | //none// | +|  ''$topicDao'' |  [[scriptlog:lib:dao:topicdao|''TopicDao'']] |  //required// |  //none// | 
-  | ''$validator'' | [[scriptlog:lib:core:formvalidator|''FormValidator'']] | //required// | //none// | +|  ''$validator'' |  [[scriptlog:lib:core:formvalidator|''FormValidator'']] |  //required// |  //none// | 
-  | ''$sanitizer'' | [[scriptlog:lib:core:sanitize|''Sanitize'']] | //required// | //none// |+|  ''$sanitizer'' |  [[scriptlog:lib:core:sanitize|''Sanitize'']] |  //required// |  //none// |
  
  
Line 82: Line 90:
 setTopicId setTopicId
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topic_id'' | ''(untyped)'' | //required// | //none// |+|  ''$topic_id'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 98: Line 106:
 setTopicTitle setTopicTitle
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topic_title'' | ''(untyped)'' | //required// | //none// |+|  ''$topic_title'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 114: Line 122:
 setTopicSlug setTopicSlug
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topic_slug'' | ''(untyped)'' | //required// | //none// |+|  ''$topic_slug'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 130: Line 138:
 setTopicStatus setTopicStatus
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topic_status'' | ''(untyped)'' | //required// | //none// |+|  ''$topic_status'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 146: Line 154:
 setTopicLocale setTopicLocale
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topic_locale'' | ''(untyped)'' | //required// | //none// |+|  ''$topic_locale'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 162: Line 170:
 grabTopics grabTopics
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// |+|  ''$orderBy'' |  ''(untyped)'' |  '''ID''' |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 178: Line 186:
 grabTopic grabTopic
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$id'' | ''(untyped)'' | //required// | //none// |+|  ''$id'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' **Returns:** ''(none declared)''
Line 194: Line 202:
 Get paginated active topics for API Get paginated active topics 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// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 228: Line 236:
 Get a single topic with post count for API Get a single topic with post count for API
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topicId'' | ''(untyped)'' | //required// | //none// |+|  ''$topicId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — array|false **Returns:** ''(none declared)'' — array|false
Line 244: Line 252:
 Get paginated posts by topic for API Get paginated posts by topic for API
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topicId'' | ''(untyped)'' | //required// | //none// | +|  ''$topicId'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$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// |
  
 **Returns:** ''(none declared)'' — array **Returns:** ''(none declared)'' — array
Line 264: Line 272:
 Count published posts by topic for API Count published posts by topic for API
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topicId'' | ''(untyped)'' | //required// | //none// |+|  ''$topicId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — integer **Returns:** ''(none declared)'' — integer
Line 325: Line 333:
 totalTopics totalTopics
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$data'' | ''array'' | ''[]'' | //none// |+|  ''$data'' |  ''array'' |  ''[]'' |  //none// |
  
 **Returns:** ''?int'' — integer|numeric|null **Returns:** ''?int'' — integer|numeric|null
Line 341: Line 349:
 localeDropDown localeDropDown
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$selected'' | ''(untyped)'' | ''""'' | //none// |+|  ''$selected'' |  ''(untyped)'' |  ''""'' |  //none// |
  
 **Returns:** ''(none declared)'' — string **Returns:** ''(none declared)'' — string
Line 357: Line 365:
 Check if a topic slug already exists. Check if a topic slug already exists.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$slug'' | ''(untyped)'' | //required// | //none// |+|  ''$slug'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — bool **Returns:** ''(none declared)'' — bool
Line 373: Line 381:
 Create a topic from raw data for the API. Create a topic 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 389: Line 397:
 Update a topic with raw data for the API. Update a topic with raw data for the API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topicId'' | ''(untyped)'' | //required// | //none// | +|  ''$topicId'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$data'' | ''array'' | //required// | //none// |+|  ''$data'' |  ''array'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 406: Line 414:
 Delete a topic and its relationships for the API. Delete a topic and its relationships for the API.
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$topicId'' | ''(untyped)'' | //required// | //none// |+|  ''$topicId'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 413: Line 421:
 ======= 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'']] | 
-  | ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] |+| ''TopicDao'' | [[scriptlog:lib:dao:topicdao|''Scriptlog\Dao\TopicDao'']] |
  
  
scriptlog/lib/service/topicservice.1790413760.txt.gz · Last modified: by admin