Completed
Push — master ( cfaf99...f93987 )
by lyu
02:05
created

GoodsDetail::setBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 5
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Kaylyu\Alipay\F2fpay\Base\Model\Builder;
4
5
class GoodsDetail
6
{
7
    // 商品编号(国标)
8
    private $goodsId;
9
10
    //支付宝定义的统一商品编号
11
    private $alipayGoodsId;
12
13
    // 商品名称
14
    private $goodsName;
15
16
    // 商品数量
17
    private $quantity;
18
19
    // 商品价格,此处单位为元,精确到小数点后2位
20
    private $price;
21
22
    // 商品类别
23
    private $goodsCategory;
24
25
    // 商品详情
26
    private $body;
27
28
    private $goodsDetail = array();
29
30
    //商品的展示地址
31
    private $showUrl;
32
33
    //商品类目树
34
    private $categoriesTree;
35
36
    //单个商品json字符串
37
    //private $goodsDetailStr = NULL;
38
39
    //获取单个商品的json字符串
40
    public function getGoodsDetail()
41
    {
42
        return $this->goodsDetail;
43
        /*$this->goodsDetailStr = "{";
44
        foreach ($this->goodsDetail as $k => $v){
45
            $this->goodsDetailStr.= "\"".$k."\":\"".$v."\",";
46
        }
47
        $this->goodsDetailStr = substr($this->goodsDetailStr,0,-1);
48
        $this->goodsDetailStr.= "}";
49
        return $this->goodsDetailStr;*/
50
    }
51
52
    public function setGoodsId($goodsId)
53
    {
54
        $this->goodsId = $goodsId;
55
        $this->goodsDetail['goods_id'] = $goodsId;
56
    }
57
58
    public function getGoodsId()
59
    {
60
        return $this->goodsId;
61
    }
62
63
    public function setAlipayGoodsId($alipayGoodsId)
64
    {
65
        $this->alipayGoodsId = $alipayGoodsId;
66
        $this->goodsDetail['alipay_goods_id'] = $alipayGoodsId;
67
    }
68
69
    public function getAlipayGoodsId()
70
    {
71
        return $this->alipayGoodsId;
72
    }
73
74
    public function setGoodsName($goodsName)
75
    {
76
        $this->goodsName = $goodsName;
77
        $this->goodsDetail['goods_name'] = $goodsName;
78
    }
79
80
    public function getGoodsName()
81
    {
82
        return $this->goodsName;
83
    }
84
85
    public function setQuantity($quantity)
86
    {
87
        $this->quantity = $quantity;
88
        $this->goodsDetail['quantity'] = $quantity;
89
    }
90
91
    public function getQuantity()
92
    {
93
        return $this->quantity;
94
    }
95
96
    public function setPrice($price)
97
    {
98
        $this->price = $price;
99
        $this->goodsDetail['price'] = $price;
100
    }
101
102
    public function getPrice()
103
    {
104
        return $this->price;
105
    }
106
107
    public function setGoodsCategory($goodsCategory)
108
    {
109
        $this->goodsCategory = $goodsCategory;
110
        $this->goodsDetail['goods_category'] = $goodsCategory;
111
    }
112
113
    public function getGoodsCategory()
114
    {
115
        return $this->goodsCategory;
116
    }
117
118
    public function setGoodsShowUrl($showUrl)
119
    {
120
        $this->showUrl = $showUrl;
121
        $this->goodsDetail['show_url'] = $showUrl;
122
    }
123
124
    public function getGoodsShowUrl()
125
    {
126
        return $this->showUrl;
127
    }
128
129
    public function setGoodsCategoryTree($categoriesTree)
130
    {
131
        $this->categoriesTree = $categoriesTree;
132
        $this->goodsDetail['categories_tree'] = $categoriesTree;
133
    }
134
135
    public function getGoodsCategoryTree()
136
    {
137
        return $this->categoriesTree;
138
    }
139
140
    public function setBody($body)
141
    {
142
        $this->body = $body;
143
        $this->goodsDetail['body'] = $body;
144
    }
145
146
    public function getBody()
147
    {
148
        return $this->body;
149
    }
150
151
152
}