Completed
Push — master ( b2abd4...891c12 )
by thomas
22:03
created

PaymentACK::setMemo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace BitWasp\Bitcoin\PaymentProtocol\Protobufs;
4
5
class PaymentACK extends \DrSlump\Protobuf\Message
6
{
7
8
    /**  @var \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Payment */
9
    public $payment;
10
11
    /**  @var string */
12
    public $memo;
13
14
15
    /** @var \Closure[] */
16
    protected static $__extensions = array();
17
18
    public static function descriptor()
19
    {
20
        $descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'payments.PaymentACK');
21
22
        // REQUIRED MESSAGE payment = 1
23
        $f = new \DrSlump\Protobuf\Field();
24
        $f->number = 1;
25
        $f->name = 'payment';
26
        $f->type = \DrSlump\Protobuf::TYPE_MESSAGE;
27
        $f->rule = \DrSlump\Protobuf::RULE_REQUIRED;
28
        $f->reference = '\BitWasp\Bitcoin\PaymentProtocol\Protobufs\Payment';
29
        $descriptor->addField($f);
30
31
        // OPTIONAL STRING memo = 2
32
        $f = new \DrSlump\Protobuf\Field();
33
        $f->number = 2;
34
        $f->name = 'memo';
35
        $f->type = \DrSlump\Protobuf::TYPE_STRING;
36
        $f->rule = \DrSlump\Protobuf::RULE_OPTIONAL;
37
        $descriptor->addField($f);
38
39
        foreach (self::$__extensions as $cb) {
40
            $descriptor->addField($cb(), true);
41
        }
42
43
        return $descriptor;
44
    }
45
46
    /**
47
     * Check if <payment> has a value
48
     *
49
     * @return boolean
50
     */
51 4
    public function hasPayment()
52
    {
53 4
        return $this->_has(1);
54
    }
55
56
    /**
57
     * Clear <payment> value
58
     *
59
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentACK
60
     */
61
    public function clearPayment()
62
    {
63
        return $this->_clear(1);
64
    }
65
66
    /**
67
     * Get <payment> value
68
     *
69
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Payment
70
     */
71 4
    public function getPayment()
72
    {
73 4
        return $this->_get(1);
74
    }
75
76
    /**
77
     * Set <payment> value
78
     *
79
     * @param \BitWasp\Bitcoin\PaymentProtocol\Protobufs\Payment $value
80
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentACK
81
     */
82 8
    public function setPayment(\BitWasp\Bitcoin\PaymentProtocol\Protobufs\Payment $value)
83
    {
84 8
        return $this->_set(1, $value);
85
    }
86
87
    /**
88
     * Check if <memo> has a value
89
     *
90
     * @return boolean
91
     */
92 4
    public function hasMemo()
93
    {
94 4
        return $this->_has(2);
95
    }
96
97
    /**
98
     * Clear <memo> value
99
     *
100
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentACK
101
     */
102
    public function clearMemo()
103
    {
104
        return $this->_clear(2);
105
    }
106
107
    /**
108
     * Get <memo> value
109
     *
110
     * @return string
111
     */
112 8
    public function getMemo()
113
    {
114 8
        return $this->_get(2);
115
    }
116
117
    /**
118
     * Set <memo> value
119
     *
120
     * @param string $value
121
     * @return \BitWasp\Bitcoin\PaymentProtocol\Protobufs\PaymentACK
122
     */
123 8
    public function setMemo($value)
124
    {
125 8
        return $this->_set(2, $value);
126
    }
127
}
128