Events   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A getGroupsSubmit() 0 5 1
A getForm() 0 4 1
A getGroupsRead() 0 5 1
A getGroupsModeration() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Countdown;
6
7
/*
8
 You may not change or alter any portion of this comment or credits
9
 of supporting developers from this source code or any supporting source code
10
 which is considered copyrighted (c) material of the original comment or credit authors.
11
12
 This program is distributed in the hope that it will be useful,
13
 but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15
*/
16
17
/**
18
 * Module: Countdown
19
 *
20
 * @category        Module
21
 * @package         countdown
22
 * @author          XOOPS Development Team <https://xoops.org>
23
 * @copyright       {@link https://xoops.org/ XOOPS Project}
24
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
25
 * @link            https://xoops.org/
26
 * @since           1.0.0
27
 */
28
29
use XoopsModules\Countdown;
30
use XoopsModules\Countdown\Form;
31
32
$moduleDirName = basename(dirname(__DIR__));
33
34
//$permHelper = new \Xmf\Module\Helper\Permission();
35
36
/**
37
 * Class Events
38
 */
39
class Events extends \XoopsObject
40
{
41
    /**
42
     * Constructor
43
     *
44
     * @param null
45
     */
46
    public function __construct()
47
    {
48
        parent::__construct();
49
        $this->initVar('event_id', XOBJ_DTYPE_INT);
50
        $this->initVar('event_uid', XOBJ_DTYPE_INT);
51
        $this->initVar('event_name', XOBJ_DTYPE_TXTBOX);
52
        $this->initVar('event_description', XOBJ_DTYPE_OTHER);
53
        $this->initVar('event_date', XOBJ_DTYPE_TIMESTAMP);
54
        $this->initVar('event_categoryid', \XOBJ_DTYPE_INT, null, true);
55
        $this->initVar('event_logo', XOBJ_DTYPE_TXTBOX);
56
        $this->initVar('date_created', \XOBJ_DTYPE_INT, 0, false);
57
        $this->initVar('date_updated', \XOBJ_DTYPE_INT, 0, false);
58
    }
59
60
    /**
61
     * Get form
62
     *
63
     * @param null
64
     * @return EventsForm
0 ignored issues
show
Bug introduced by
The type XoopsModules\Countdown\EventsForm was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
65
     */
66
    public function getForm()
67
    {
68
        $form = new Form\EventsForm($this);
69
        return $form;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $form returns the type XoopsModules\Countdown\Form\EventsForm which is incompatible with the documented return type XoopsModules\Countdown\EventsForm.
Loading history...
70
    }
71
72
    /**
73
     * @return array|null
74
     */
75
    public function getGroupsRead()
76
    {
77
        $permHelper = new \Xmf\Module\Helper\Permission();
78
        //return $this->publisher->getHandler('permission')->getGrantedGroupsById('events_read', id);
79
        return $permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('event_id'));
80
    }
81
82
    /**
83
     * @return array|null
84
     */
85
    public function getGroupsSubmit()
86
    {
87
        $permHelper = new \Xmf\Module\Helper\Permission();
88
        //        return $this->publisher->getHandler('permission')->getGrantedGroupsById('events_submit', id);
89
        return $permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('event_id'));
90
    }
91
92
    /**
93
     * @return array|null
94
     */
95
    public function getGroupsModeration()
96
    {
97
        $permHelper = new \Xmf\Module\Helper\Permission();
98
        //        return $this->publisher->getHandler('permission')->getGrantedGroupsById('events_moderation', id);
99
        return $permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('event_id'));
100
    }
101
}
102
103