Passed
Push — master ( 6af1fb...f5fe55 )
by Michael
02:53 queued 10s
created

IplogHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

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

2 Methods

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