Passed
Pull Request — master (#3)
by Timothy
06:14
created

Payload   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 70
rs 10
wmc 5
1
<?php
2
# Generated by the protocol buffer compiler.  DO NOT EDIT!
3
# source: common/common.proto
4
5
namespace Hyperledger\Fabric\Protos\Common;
6
7
use Google\Protobuf\Internal\GPBType;
8
use Google\Protobuf\Internal\RepeatedField;
9
use Google\Protobuf\Internal\GPBUtil;
10
11
/**
12
 * Payload is the message contents (and header to allow for signing)
13
 *
14
 * Generated from protobuf message <code>common.Payload</code>
15
 */
16
class Payload extends \Google\Protobuf\Internal\Message
17
{
18
    /**
19
     * Header is included to provide identity and prevent replay
20
     *
21
     * Generated from protobuf field <code>.common.Header header = 1;</code>
22
     */
23
    private $header = null;
24
    /**
25
     * Data, the encoding of which is defined by the type in the header
26
     *
27
     * Generated from protobuf field <code>bytes data = 2;</code>
28
     */
29
    private $data = '';
30
31
    public function __construct() {
32
        \GPBMetadata\Common\Common::initOnce();
33
        parent::__construct();
34
    }
35
36
    /**
37
     * Header is included to provide identity and prevent replay
38
     *
39
     * Generated from protobuf field <code>.common.Header header = 1;</code>
40
     * @return \Hyperledger\Fabric\Protos\Common\Header
41
     */
42
    public function getHeader()
43
    {
44
        return $this->header;
45
    }
46
47
    /**
48
     * Header is included to provide identity and prevent replay
49
     *
50
     * Generated from protobuf field <code>.common.Header header = 1;</code>
51
     * @param \Hyperledger\Fabric\Protos\Common\Header $var
52
     * @return $this
53
     */
54
    public function setHeader($var)
55
    {
56
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Common\Header::class);
57
        $this->header = $var;
58
59
        return $this;
60
    }
61
62
    /**
63
     * Data, the encoding of which is defined by the type in the header
64
     *
65
     * Generated from protobuf field <code>bytes data = 2;</code>
66
     * @return string
67
     */
68
    public function getData()
69
    {
70
        return $this->data;
71
    }
72
73
    /**
74
     * Data, the encoding of which is defined by the type in the header
75
     *
76
     * Generated from protobuf field <code>bytes data = 2;</code>
77
     * @param string $var
78
     * @return $this
79
     */
80
    public function setData($var)
81
    {
82
        GPBUtil::checkString($var, False);
83
        $this->data = $var;
84
85
        return $this;
86
    }
87
88
}
89
90