Failed Conditions
Pull Request — experimental/sf (#3236)
by Kentaro
49:41 queued 37:58
created

ProductStock::setCreateDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of EC-CUBE
5
 *
6
 * Copyright(c) LOCKON CO.,LTD. All Rights Reserved.
7
 *
8
 * http://www.lockon.co.jp/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Eccube\Entity;
15
16
use Doctrine\ORM\Mapping as ORM;
17
18
/**
19
 * ProductStock
20
 *
21
 * @ORM\Table(name="dtb_product_stock")
22
 * @ORM\InheritanceType("SINGLE_TABLE")
23
 * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
24
 * @ORM\HasLifecycleCallbacks()
25
 * @ORM\Entity(repositoryClass="Eccube\Repository\ProductStockRepository")
26
 */
27
class ProductStock extends \Eccube\Entity\AbstractEntity
28
{
29
    const IN_STOCK = 1;
30
    const OUT_OF_STOCK = 2;
31
32
    /**
33
     * @var integer
34
     */
35
    private $product_class_id;
36
37
    /**
38
     * Set product_class_id
39
     *
40
     * @param integer $productClassId
41
     *
42
     * @return ProductStock
43
     */
44 314
    public function setProductClassId($productClassId)
45
    {
46 314
        $this->product_class_id = $productClassId;
47
48 314
        return $this;
49
    }
50
51
    /**
52
     * Get product_class_id
53
     *
54
     * @return integer
55
     */
56
    public function getProductClassId()
57
    {
58
        return $this->product_class_id;
59
    }
60
61
    /**
62
     * @var integer
63
     *
64
     * @ORM\Column(name="id", type="integer", options={"unsigned":true})
65
     * @ORM\Id
66
     * @ORM\GeneratedValue(strategy="IDENTITY")
67
     */
68
    private $id;
69
70
    /**
71
     * @var string|null
72
     *
73
     * @ORM\Column(name="stock", type="decimal", precision=10, scale=0, nullable=true)
74
     */
75
    private $stock;
76
77
    /**
78
     * @var \DateTime
79
     *
80
     * @ORM\Column(name="create_date", type="datetimetz")
81
     */
82
    private $create_date;
83
84
    /**
85
     * @var \DateTime
86
     *
87
     * @ORM\Column(name="update_date", type="datetimetz")
88
     */
89
    private $update_date;
90
91
    /**
92
     * @var \Eccube\Entity\ProductClass
93
     *
94
     * @ORM\OneToOne(targetEntity="Eccube\Entity\ProductClass", inversedBy="ProductStock")
95
     * @ORM\JoinColumns({
96
     *   @ORM\JoinColumn(name="product_class_id", referencedColumnName="id")
97
     * })
98
     */
99
    private $ProductClass;
100
101
    /**
102
     * @var \Eccube\Entity\Member
103
     *
104
     * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member")
105
     * @ORM\JoinColumns({
106
     *   @ORM\JoinColumn(name="creator_id", referencedColumnName="id")
107
     * })
108
     */
109
    private $Creator;
110
111
    /**
112
     * Get id.
113
     *
114
     * @return int
115
     */
116
    public function getId()
117
    {
118
        return $this->id;
119
    }
120
121
    /**
122
     * Set stock.
123
     *
124
     * @param string|null $stock
125
     *
126
     * @return ProductStock
127
     */
128 326
    public function setStock($stock = null)
129
    {
130 326
        $this->stock = $stock;
131
132 326
        return $this;
133
    }
134
135
    /**
136
     * Get stock.
137
     *
138
     * @return string|null
139
     */
140 310
    public function getStock()
141
    {
142 310
        return $this->stock;
143
    }
144
145
    /**
146
     * Set createDate.
147
     *
148
     * @param \DateTime $createDate
149
     *
150
     * @return ProductStock
151
     */
152 324
    public function setCreateDate($createDate)
153
    {
154 324
        $this->create_date = $createDate;
155
156 324
        return $this;
157
    }
158
159
    /**
160
     * Get createDate.
161
     *
162
     * @return \DateTime
163
     */
164
    public function getCreateDate()
165
    {
166
        return $this->create_date;
167
    }
168
169
    /**
170
     * Set updateDate.
171
     *
172
     * @param \DateTime $updateDate
173
     *
174
     * @return ProductStock
175
     */
176 324
    public function setUpdateDate($updateDate)
177
    {
178 324
        $this->update_date = $updateDate;
179
180 324
        return $this;
181
    }
182
183
    /**
184
     * Get updateDate.
185
     *
186
     * @return \DateTime
187
     */
188
    public function getUpdateDate()
189
    {
190
        return $this->update_date;
191
    }
192
193
    /**
194
     * Set productClass.
195
     *
196
     * @param \Eccube\Entity\ProductClass|null $productClass
197
     *
198
     * @return ProductStock
199
     */
200 325
    public function setProductClass(\Eccube\Entity\ProductClass $productClass = null)
201
    {
202 325
        $this->ProductClass = $productClass;
203
204 325
        return $this;
205
    }
206
207
    /**
208
     * Get productClass.
209
     *
210
     * @return \Eccube\Entity\ProductClass|null
211
     */
212
    public function getProductClass()
213
    {
214
        return $this->ProductClass;
215
    }
216
217
    /**
218
     * Set creator.
219
     *
220
     * @param \Eccube\Entity\Member|null $creator
221
     *
222
     * @return ProductStock
223
     */
224 324
    public function setCreator(\Eccube\Entity\Member $creator = null)
225
    {
226 324
        $this->Creator = $creator;
227
228 324
        return $this;
229
    }
230
231
    /**
232
     * Get creator.
233
     *
234
     * @return \Eccube\Entity\Member|null
235
     */
236
    public function getCreator()
237
    {
238
        return $this->Creator;
239
    }
240
}
241