Passed
Push — master ( feaee9...2b3e4e )
by Alex
04:28
created

TDerivableTypeAttributesTrait::getAbstract()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm\Groups;
4
5
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TQualifiedNameTrait;
6
7
trait TDerivableTypeAttributesTrait
8
{
9
    use TQualifiedNameTrait;
10
    /**
11
     * @property string $baseType
12
     */
13
    private $baseType = null;
14
15
    /**
16
     * @property boolean $abstract
17
     */
18
    private $abstract = false;
19
20
    /**
21
     * Gets as baseType
22
     *
23
     * @return string
24
     */
25
    public function getBaseType()
26
    {
27
        return $this->baseType;
28
    }
29
30
    /**
31
     * Sets a new baseType
32
     *
33
     * @param string $baseType
34
     * @return self
35
     */
36
    public function setBaseType($baseType)
37
    {
38
        $this->baseType = $baseType;
39
        return $this;
40
    }
41
42
    /**
43
     * Gets as abstract
44
     *
45
     * @return boolean
46
     */
47
    public function getAbstract()
48
    {
49
        return boolval($this->abstract);
50
    }
51
52
    /**
53
     * Sets a new abstract
54
     *
55
     * @param boolean $abstract
56
     * @return self
57
     */
58
    public function setAbstract($abstract)
59
    {
60
        $this->abstract = boolval($abstract);
61
        return $this;
62
    }
63
64
    public function isTDerivableTypeAttributesValid(&$msg)
65
    {
66
        if (null != $this->baseType && !$this->isTQualifiedNameValid($this->baseType)) {
67
            $msg = "Base type must be a valid TQualifiedName";
68
            return false;
69
        }
70
        return true;
71
    }
72
}
73