Passed
Pull Request — master (#27)
by Michael
03:03
created

MimetypeHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace XoopsModules\Wfdownloads;
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
 * Wfdownloads module
17
 *
18
 * @copyright       XOOPS Project (https://xoops.org)
19
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
20
 * @package         wfdownload
21
 * @since           3.23
22
 * @author          Xoops Development Team
23
 */
24
25
use XoopsModules\Wfdownloads;
26
27
/*
28
CREATE TABLE wfdownloads_mimetypes (
29
  mime_id int(11) NOT NULL auto_increment,
30
  mime_ext varchar(60) NOT NULL default '',
31
  mime_types text NOT NULL,
32
  mime_name varchar(255) NOT NULL default '',
33
  mime_admin int(1) NOT NULL default '1',
34
  mime_user int(1) NOT NULL default '0',
35
  KEY mime_id (mime_id)
36
) ENGINE=MyISAM;
37
*/
38
39
require_once \dirname(__DIR__) . '/include/common.php';
40
41
/**
42
 * Class MimetypeHandler
43
 */
44
class MimetypeHandler extends \XoopsPersistableObjectHandler
45
{
46
    /**
47
     * @access public
48
     */
49
    public $helper;
50
51
    /**
52
     * @param \XoopsDatabase|null $db
53
     */
54
    public function __construct(\XoopsDatabase $db = null)
55
    {
56
        parent::__construct($db, 'wfdownloads_mimetypes', Mimetype::class, 'mime_id', 'mime_ext');
57
        /** @var \XoopsModules\Wfdownloads\Helper $helper */
58
        $this->helper = Helper::getInstance();
59
    }
60
}
61