newbbSetReadTopic()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * NewBB 5.0x,  the forum module for XOOPS project
4
 *
5
 * @copyright      XOOPS Project (https://xoops.org)
6
 * @license        GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
7
 * @author         Taiwen Jiang (phppp or D.J.) <[email protected]>
8
 * @since          4.00
9
 * @package        module::newbb
10
 */
11
12
use XoopsModules\Newbb;
13
14
15
16
defined('NEWBB_FUNCTIONS_INI') || require __DIR__ . '/functions.ini.php';
17
define('NEWBB_FUNCTIONS_READ_LOADED', true);
18
19
if (!defined('NEWBB_FUNCTIONS_READ')) {
20
    define('NEWBB_FUNCTIONS_READ', 1);
21
22
    /**
23
     * @param        $type
24
     * @param        $item_id
25
     * @param        $post_id
26
     * @param null   $uid
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $uid is correct as it would always require null to be passed?
Loading history...
27
     * @return mixed
28
     */
29
    function newbbSetRead($type, $item_id, $post_id, $uid = null)
30
    {
31
        /** @var Newbb\ReadHandler $readHandler */
32
        $readHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Read' . $type);
33
34
        return $readHandler->setRead($item_id, $post_id, $uid);
35
    }
36
37
    /**
38
     * @param        $type
39
     * @param        $item_id
40
     * @param null   $uid
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $uid is correct as it would always require null to be passed?
Loading history...
41
     * @return mixed
42
     */
43
    function newbbGetRead($type, $item_id, $uid = null)
44
    {
45
        /** @var Newbb\ReadHandler $readHandler */
46
        $readHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Read' . $type);
47
48
        return $readHandler->getRead($item_id, $uid);
49
    }
50
51
    /**
52
     * @param int  $status
53
     * @param null $uid
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $uid is correct as it would always require null to be passed?
Loading history...
54
     * @return mixed
55
     */
56
    function newbbSetReadforum($status = 0, $uid = null)
57
    {
58
        /** @var Newbb\ReadforumHandler $readHandler */
59
        $ReadforumHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Readforum');
60
61
        return $ReadforumHandler->setReadItems($status, $uid);
62
    }
63
64
    /**
65
     * @param int  $status
66
     * @param int  $forum_id
67
     * @param null $uid
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $uid is correct as it would always require null to be passed?
Loading history...
68
     * @return mixed
69
     */
70
    function newbbSetReadTopic($status = 0, $forum_id = 0, $uid = null)
71
    {
72
        /** @var Newbb\ReadtopicHandler $readHandler */
73
        $readTopicHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Readtopic');
74
75
        return $readTopicHandler->setReadItems($status, $forum_id, $uid);
76
    }
77
78
    /**
79
     * @param        $type
80
     * @param        $items
81
     * @param null   $uid
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $uid is correct as it would always require null to be passed?
Loading history...
82
     * @return mixed
83
     */
84
    function newbbIsRead($type, $items, $uid = null)
85
    {
86
        /** @var Newbb\ReadHandler $readHandler */
87
        $readHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Read' . $type);
88
89
        return $readHandler->isReadItems($items, $uid);
90
    }
91
}
92