====== TopicDao ====== **Layer:** ''DAO'' · **Source:** ''lib/dao/TopicDao.php:20'' (lines 20–430) ---- class TopicDao extends Dao ======= Docblock Metadata ======= ^ Tag ^ Value ^ | ''@category'' | Dao Class | | ''@author'' | M.Noermoehammad | | ''@license'' | MIT | | ''@version'' | 1.0 | | ''@since'' | Since Release 1.0 | ======= Inheritance ======= ^ Relation ^ Type ^ Meaning ^ | extends | [[scriptlog:lib:core:dao|''Dao'']] | parent class/interface | ======= Constants (0) ======= //None.// ======= Properties (0) ======= //None declared.// ======= Methods (20) ======= ^ Visibility ^ Method ^ Summary ^ Line ^ | public | ''__construct()'' | overrides Dao constructor | 25 | | public | ''findTopics()'' | Find All Topics | 38 | | public | ''findActiveTopicsPaginated()'' | Find active topics with pagination and post count for API | 58 | | public | ''countActiveTopics()'' | Count active topics | 86 | | public | ''findTopicWithPostCount()'' | Find a single topic with post count | 100 | | public | ''findPostsByTopicPaginated()'' | Find published posts by topic with pagination | 126 | | public | ''countPostsByTopic()'' | Count published posts by topic | 157 | | public | ''findTopicById()'' | Find Topic by ID | 180 | | public | ''findPostTopic()'' | findPostTopic | 201 | | public | ''createTopic()'' | Insert a new records | 220 | | public | ''updateTopic()'' | Update an existing records | 240 | | public | ''deleteTopic()'' | Delete an existing records | 259 | | public | ''setCheckBoxTopic()'' | Set topic | 274 | | public | ''checkTopicId()'' | Check Id'topic | 347 | | public | ''findTopicBySlug()'' | Find a topic by slug (for duplicate checking). | 369 | | public | ''insertTopicApi()'' | Insert a topic with the given data and return the new ID. | 382 | | public | ''updateTopicApi()'' | Update specific topic fields. | 395 | | public | ''deleteTopicCascade()'' | Delete topic relationships then the topic itself. | 406 | | public | ''totalTopicRecords()'' | (undocumented) | 412 | | public | ''dropDownLocale()'' | Drop down locale | 426 | ======== __construct() ======== public function __construct() //lines 25–28 (4)// overrides Dao constructor //Takes no parameters.// ======== findTopics() ======== public function findTopics($orderBy = 'ID') //lines 38–47 (10)// Find All Topics ^ Parameter ^ Type ^ Default ^ Description ^ | ''$orderBy'' | ''(untyped)'' | '''ID''' | //none// | **Returns:** ''(none declared)'' — mixed ======== findActiveTopicsPaginated() ======== public function findActiveTopicsPaginated($limit, $offset, $sortBy = 'ID', $sortOrder = 'DESC') //lines 58–79 (22)// Find active topics with pagination and post count for API ^ Parameter ^ Type ^ Default ^ Description ^ | ''$limit'' | ''(untyped)'' | //required// | //none// | | ''$offset'' | ''(untyped)'' | //required// | //none// | | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | **Returns:** ''(none declared)'' — array ======== countActiveTopics() ======== public function countActiveTopics() //lines 86–92 (7)// Count active topics //Takes no parameters.// **Returns:** ''(none declared)'' — integer ======== findTopicWithPostCount() ======== public function findTopicWithPostCount($topicId) //lines 100–114 (15)// Find a single topic with post count ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — array|false ======== findPostsByTopicPaginated() ======== public function findPostsByTopicPaginated($topicId, $limit, $offset, $sortBy = 'ID', $sortOrder = 'DESC') //lines 126–149 (24)// Find published posts by topic with pagination ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | | ''$limit'' | ''(untyped)'' | //required// | //none// | | ''$offset'' | ''(untyped)'' | //required// | //none// | | ''$sortBy'' | ''(untyped)'' | '''ID''' | //none// | | ''$sortOrder'' | ''(untyped)'' | '''DESC''' | //none// | **Returns:** ''(none declared)'' — array ======== countPostsByTopic() ======== public function countPostsByTopic($topicId) //lines 157–170 (14)// Count published posts by topic ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — integer ======== findTopicById() ======== public function findTopicById($topicId, $sanitize, $fetchMode = null) //lines 180–192 (13)// Find Topic by ID ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | | ''$sanitize'' | ''(untyped)'' | //required// | //none// | | ''$fetchMode'' | ''(untyped)'' | ''null'' | //none// | **Returns:** ''(none declared)'' — mixed ======== findPostTopic() ======== public function findPostTopic($topicId, $postId) //lines 201–211 (11)// findPostTopic ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | | ''$postId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — boolean|array|object ======== createTopic() ======== public function createTopic($bind) //lines 220–230 (11)// Insert a new records ^ Parameter ^ Type ^ Default ^ Description ^ | ''$bind'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' ======== updateTopic() ======== public function updateTopic($sanitize, $bind, $topicId) //lines 240–251 (12)// Update an existing records ^ Parameter ^ Type ^ Default ^ Description ^ | ''$sanitize'' | ''(untyped)'' | //required// | //none// | | ''$bind'' | ''(untyped)'' | //required// | //none// | | ''$topicId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' ======== deleteTopic() ======== public function deleteTopic($topicId, $sanitize) //lines 259–264 (6)// Delete an existing records ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | | ''$sanitize'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' ======== setCheckBoxTopic() ======== public function setCheckBoxTopic($postId = null, $checked = null) //lines 274–336 (63)// Set topic post category ^ Parameter ^ Type ^ Default ^ Description ^ | ''$postId'' | ''(untyped)'' | ''null'' | //none// | | ''$checked'' | ''(untyped)'' | ''null'' | //none// | **Returns:** ''(none declared)'' — string ======== checkTopicId() ======== public function checkTopicId($id, $sanitizing) //lines 347–354 (8)// Check Id'topic ^ Parameter ^ Type ^ Default ^ Description ^ | ''$id'' | ''(untyped)'' | //required// | //none// | | ''$sanitizing'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — numeric ======== findTopicBySlug() ======== public function findTopicBySlug($slug) //lines 369–374 (6)// Find a topic by slug (for duplicate checking). ^ Parameter ^ Type ^ Default ^ Description ^ | ''$slug'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — array|false ======== insertTopicApi() ======== public function insertTopicApi(array $data) //lines 382–386 (5)// Insert a topic with the given data and return the new ID. ^ Parameter ^ Type ^ Default ^ Description ^ | ''$data'' | ''array'' | //required// | //none// | **Returns:** ''(none declared)'' — int ======== updateTopicApi() ======== public function updateTopicApi($topicId, array $data) //lines 395–398 (4)// Update specific topic fields. ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | | ''$data'' | ''array'' | //required// | //none// | **Returns:** ''(none declared)'' — void ======== deleteTopicCascade() ======== public function deleteTopicCascade($topicId) //lines 406–410 (5)// Delete topic relationships then the topic itself. ^ Parameter ^ Type ^ Default ^ Description ^ | ''$topicId'' | ''(untyped)'' | //required// | //none// | **Returns:** ''(none declared)'' — void ======== totalTopicRecords() ======== public function totalTopicRecords(array $data = []): ?int //lines 412–417 (6)// ^ Parameter ^ Type ^ Default ^ Description ^ | ''$data'' | ''array'' | ''[]'' | //none// | **Returns:** ''?int'' ======== dropDownLocale() ======== public function dropDownLocale($selected = "") //lines 426–429 (4)// Drop down locale ^ Parameter ^ Type ^ Default ^ Description ^ | ''$selected'' | ''(untyped)'' | ''""'' | //none// | **Returns:** ''(none declared)'' — string ======= Imports ======= ^ Alias ^ Fully-qualified name ^ | ''Dao'' | [[scriptlog:lib:core:dao|''Scriptlog\Core\Dao'']] | ---- //This page is generated from source by 'tools/gendoc'. Edits will be overwritten.//