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

AppControlType   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 39
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDraft() 0 4 1
A setDraft() 0 5 1
A isOK() 0 8 3
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