Completed
Pull Request — master (#20)
by
unknown
05:38
created

Metadata::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
namespace samsoncms\api\generator;
3
4
/**
5
 * Created by Vitaly Iegorov <[email protected]>.
6
 * on 11.02.16 at 18:07
7
 */
8
class Metadata
9
{
10
    /** Default type of metadata */
11
    const TYPE_DEFAULT = 0;
12
13
    /** Nested materials type of metadata */
14
    const TYPE_NESTED_MATERIAL = 1;
15
16
    /** Table type of metadata */
17
    const TYPE_TABLE = 2;
18
19
    /** @var array List of types */
20
    public static $types = array(
21
        self::TYPE_DEFAULT,
22
        self::TYPE_NESTED_MATERIAL,
23
        self::TYPE_TABLE,
24
    );
25
26
    /**
27
     * Metadata constructor.
28
     * @param int $type
29
     */
30
    public function __construct($type = self::TYPE_DEFAULT)
31
    {
32
        $this->type = $type;
0 ignored issues
show
Documentation Bug introduced by
The property $type was declared of type string, but $type is of type integer. Maybe add a type cast?

This check looks for assignments to scalar types that may be of the wrong type.

To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.

$answer = 42;

$correct = false;

$correct = (bool) $answer;
Loading history...
33
    }
34
35
    /** @var string Type of entity */
36
    public $type;
37
    /** @var string Transliterated and CapsCase entity name */
38
    public $entity;
39
    /** @var string Real database entity identifier */
40
    public $entityID;
41
    /** @var string Real database entity name */
42
    public $entityRealName;
43
    /** @var int Parent entity identifier  */
44
    public $parentID;
45
    /** @var $this Metadata parent entity name */
46
    public $parent;
47
    /** @var string Generated entity fully qualified class name */
48
    public $className;
49
50
    // To be commented
51
    public $realNames = array();
52
    public $allFieldIDs = array();
53
    public $allFieldNames = array();
54
    public $allFieldValueColumns = array();
55
    public $localizedFieldIDs = array();
56
    public $notLocalizedFieldIDs = array();
57
    public $allFieldTypes = array();
58
    public $fieldDescriptions= array();
59
60
    // Old AR fields
61
    public $arSelect = array();
62
    public $arMap = array();
63
    public $arAttributes = array();
64
    public $arFrom = array();
65
    public $arGroup = array();
66
    public $arRelationAlias = array();
67
    public $arRelationType = array();
68
    public $arRelations = array();
69
}
70