Passed
Push — master ( 2f53de...d51943 )
by Michael
05:25 queued 02:22
created

PicturesHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 2
b 0
f 0
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 6 1
A __construct() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace XoopsModules\Adslight;
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: Adslight
19
 *
20
 * @category        Module
21
 * @author          XOOPS Development Team <https://xoops.org>
22
 * @copyright       {@link https://xoops.org/ XOOPS Project}
23
 * @license         GPL 2.0 or later
24
 */
25
26
use XoopsModules\Adslight;
27
28
$moduleDirName = \basename(\dirname(__DIR__));
29
30
$permHelper = new \Xmf\Module\Helper\Permission();
31
32
/**
33
 * Class PicturesHandler
34
 */
35
class PicturesHandler extends \XoopsPersistableObjectHandler
36
{
37
    /**
38
     * @var Helper
39
     */
40
    public $helper;
41
42
    /**
43
     * Constructor
44
     * @param null|\XoopsDatabase                $db
45
     * @param null|\XoopsModules\Adslight\Helper $helper
46
     */
47
48
    public function __construct(\XoopsDatabase $db = null, $helper = null)
49
    {
50
        /** @var \XoopsModules\Adslight\Helper $this- >helper */
51
        $this->helper = $helper;
52
        parent::__construct($db, 'adslight_pictures', Pictures::class, 'cod_img', 'title');
53
    }
54
55
    /**
56
     * @param bool $isNew
57
     *
58
     * @return \XoopsObject
59
     */
60
    public function create($isNew = true)
61
    {
62
        $obj         = parent::create($isNew);
63
        $obj->helper = $this->helper;
64
65
        return $obj;
66
    }
67
}
68