| Next revision | Previous revision |
| scriptlog:lib:service:topicservice [2026/09/26 09:09] – admin admin | scriptlog:lib:service:topicservice [2026/09/26 09:34] (current) – admin admin |
|---|
| ======= 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 ======= |
| //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 | |
| |
| |
| //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// | |
| |
| |
| 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)'' |
| 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)'' |
| 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)'' |
| 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)'' |
| 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)'' |
| grabTopics | grabTopics |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// | | | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| grabTopic | grabTopic |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$id'' | ''(untyped)'' | //required// | //none// | | | ''$id'' | ''(untyped)'' | //required// | //none// | |
| |
| **Returns:** ''(none declared)'' | **Returns:** ''(none declared)'' |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| localeDropDown | localeDropDown |
| |
| ^ Parameter ^ Type ^ Default ^ Description ^ | ^ Parameter ^ Type ^ Default ^ Description ^ |
| | ''$selected'' | ''(untyped)'' | ''""'' | //none// | | | ''$selected'' | ''(untyped)'' | ''""'' | //none// | |
| |
| **Returns:** ''(none declared)'' — string | **Returns:** ''(none declared)'' — string |
| 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 |
| 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 |
| 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 |
| 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 |
| ======= 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'']] | |
| |
| |