Fieldattributes::getValuesFieldattributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 3
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php namespace XoopsModules\Tdmcreate;
2
3
use XoopsModules\Tdmcreate;
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
 * tdmcreate module.
16
 *
17
 * @copyright       XOOPS Project (https://xoops.org)
18
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
19
 *
20
 * @since           2.5.7
21
 *
22
 * @author          Txmod Xoops <[email protected]> - <http://www.txmodxoops.org/>
23
 *
24
 * @version         $Id: 1.91 fieldattributes.php 13027 2015-02-14 12:18:10Z timgno $
25
 */
26
27
 /**
28
*  @Class Fieldattributes
29
*  @extends \XoopsObject
30
*/
31
32
/**
33
 * Class Fieldattributes.
34
 */
35
class Fieldattributes extends \XoopsObject
36
{
37
    /**
38
    *  @public function constructor class
39
    *  @param null
40
    */
41
42
    public function __construct()
43
    {
44
        $this->initVar('fieldattribute_id', XOBJ_DTYPE_INT);
45
        $this->initVar('fieldattribute_name', XOBJ_DTYPE_TXTBOX);
46
        $this->initVar('fieldattribute_value', XOBJ_DTYPE_TXTBOX);
47
    }
48
49
    /**
50
    *  @static function getInstance
51
    *  @param null
52
     * @return Fieldattributes
53
     */
54
    public static function getInstance()
55
    {
56
        static $instance = false;
57
        if (!$instance) {
58
            $instance = new self();
59
        }
60
61
        return $instance;
62
    }
63
64
    /**
65
     * Get Values.
66
     * @param null $keys
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $keys is correct as it would always require null to be passed?
Loading history...
67
     * @param null $format
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $format is correct as it would always require null to be passed?
Loading history...
68
     * @param null $maxDepth
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $maxDepth is correct as it would always require null to be passed?
Loading history...
69
     * @return array
70
     */
71
    public function getValuesFieldattributes($keys = null, $format = null, $maxDepth = null)
72
    {
73
        $ret = $this->getValues($keys, $format, $maxDepth);
74
        // Values
75
        $ret['id'] = $this->getVar('fieldattribute_id');
76
        $ret['name'] = $this->getVar('fieldattribute_name');
77
        $ret['value'] = $this->getVar('fieldattribute_value');
78
79
        return $ret;
80
    }
81
}
82