Completed
Pull Request — master (#98)
by Christopher
05:13
created

AppControlType::isOK()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 2
nop 1
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\App;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
7
/**
8
 * Class representing AppControlType
9
 *
10
 *
11
 * XSD Type: appControlType
12
 */
13
class AppControlType extends IsOK
14
{
15
16
    /**
17
     * @property string $draft
18
     */
19
    private $draft = null;
20
21
    /**
22
     * Gets as draft
23
     *
24
     * @return string
25
     */
26
    public function getDraft()
27
    {
28
        return $this->draft;
29
    }
30
31
    /**
32
     * Sets a new draft
33
     *
34
     * @param string $draft
35
     * @return self
36
     */
37
    public function setDraft($draft)
38
    {
39
        $this->draft = $draft;
40
        return $this;
41
    }
42
43
    public function isOK(&$msg = null)
44
    {
45
        if ("yes" != $this->draft && "no" != $this->draft) {
46
            $msg = "AppControlType only two valid values for draft are yes and no.";
47
            return false;
48
        }
49
        return true;
50
    }
51
}
52