Picture   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 24
c 0
b 0
f 0
dl 0
loc 71
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getGroupsSubmit() 0 4 1
A getGroupsRead() 0 4 1
A getForm() 0 5 1
A __construct() 0 14 1
A getGroupsModeration() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Adslight;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * Module: Adslight
17
 *
18
 * @category        Module
19
 * @author          XOOPS Development Team <https://xoops.org>
20
 * @copyright       {@link https://xoops.org/ XOOPS Project}
21
 * @license         GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
22
 */
23
24
use XoopsModules\Adslight\{
25
    Form
26
};
27
28
//$permHelper = new \Xmf\Module\Helper\Permission();
29
30
/**
31
 * Class Pictures
32
 */
33
class Picture extends \XoopsObject
34
{
35
    public $cod_img;
36
    public $title;
37
    public $date_created;
38
    public $date_updated;
39
    public $lid;
40
    public $uid_owner;
41
    public $url;
42
    public $helper;
43
    public $permHelper;
44
45
    /**
46
     * Constructor
47
     *
48
     * @param null
49
     */
50
    public function __construct()
51
    {
52
        parent::__construct();
53
        // /** @var Adslight\Helper $helper */
54
        //        $this->helper = Adslight\Helper::getInstance();
55
        $this->permHelper = new \Xmf\Module\Helper\Permission();
56
57
        $this->initVar('cod_img', \XOBJ_DTYPE_INT);
58
        $this->initVar('title', \XOBJ_DTYPE_TXTBOX);
59
        $this->initVar('date_created', \XOBJ_DTYPE_INT);
60
        $this->initVar('date_updated', \XOBJ_DTYPE_INT);
61
        $this->initVar('lid', \XOBJ_DTYPE_INT);
62
        $this->initVar('uid_owner', \XOBJ_DTYPE_TXTBOX);
63
        $this->initVar('url', \XOBJ_DTYPE_OTHER);
64
    }
65
66
    /**
67
     * Get form
68
     *
69
     * @param null
70
     * @return Form\PicturesForm
71
     */
72
    public function getForm(): Form\PicturesForm
73
    {
74
        $form = new Form\PicturesForm($this);
75
76
        return $form;
77
    }
78
79
    /**
80
     * @return array|null
81
     */
82
    public function getGroupsRead(): ?array
83
    {
84
        //$permHelper = new \Xmf\Module\Helper\Permission();
85
        return $this->permHelper->getGroupsForItem('sbcolumns_read', $this->getVar('cod_img'));
86
    }
87
88
    /**
89
     * @return array|null
90
     */
91
    public function getGroupsSubmit(): ?array
92
    {
93
        //$permHelper = new \Xmf\Module\Helper\Permission();
94
        return $this->permHelper->getGroupsForItem('sbcolumns_submit', $this->getVar('cod_img'));
95
    }
96
97
    /**
98
     * @return array|null
99
     */
100
    public function getGroupsModeration(): ?array
101
    {
102
        //$permHelper = new \Xmf\Module\Helper\Permission();
103
        return $this->permHelper->getGroupsForItem('sbcolumns_moderation', $this->getVar('cod_img'));
104
    }
105
}
106