Passed
Push — master ( 4f7966...46bec3 )
by Alex
04:29
created

TEntityTypeModificationFunctionType::isOK()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
rs 9.4285
cc 3
eloc 7
nc 3
nop 1
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\mapping\cs;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\Groups\TEntityTypeModificationFunctionMappingPropertyGroup;
7
8
/**
9
 * Class representing TEntityTypeModificationFunctionType
10
 *
11
 * Type for entity type DeleteFunction
12
 *
13
 * XSD Type: TEntityTypeModificationFunction
14
 */
15
class TEntityTypeModificationFunctionType extends IsOK
16
{
17
    use TEntityTypeModificationFunctionMappingPropertyGroup;
18
    /**
19
     * @property string $functionName
20
     */
21
    private $functionName = null;
22
23
    /**
24
     * @property string $rowsAffectedParameter
25
     */
26
    private $rowsAffectedParameter = null;
27
28
    /**
29
     * Gets as functionName
30
     *
31
     * @return string
32
     */
33
    public function getFunctionName()
34
    {
35
        return $this->functionName;
36
    }
37
38
    /**
39
     * Sets a new functionName
40
     *
41
     * @param string $functionName
42
     * @return self
43
     */
44
    public function setFunctionName($functionName)
45
    {
46
        $this->functionName = $functionName;
47
        return $this;
48
    }
49
50
    /**
51
     * Gets as rowsAffectedParameter
52
     *
53
     * @return string
54
     */
55
    public function getRowsAffectedParameter()
56
    {
57
        return $this->rowsAffectedParameter;
58
    }
59
60
    /**
61
     * Sets a new rowsAffectedParameter
62
     *
63
     * @param string $rowsAffectedParameter
64
     * @return self
65
     */
66
    public function setRowsAffectedParameter($rowsAffectedParameter)
67
    {
68
        $this->rowsAffectedParameter = $rowsAffectedParameter;
69
        return $this;
70
    }
71
72
    public function isOK(&$msg = null)
73
    {
74
        if (!$this->isStringNotNullOrEmpty($this->functionName)) {
75
            $msg = 'Function name cannot be null or empty';
76
            return false;
77
        }
78
        if (!$this->isMappingPropertyGroupOK($msg)) {
79
            return false;
80
        }
81
82
        return true;
83
    }
84
}
85