Failed Conditions
Pull Request — experimental/sf (#29)
by Kentaro
50:12 queued 39:05
created

Template::getDeviceType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
crap 2
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
 * Template
20
 *
21
 * @ORM\Table(name="dtb_template")
22
 * @ORM\InheritanceType("SINGLE_TABLE")
23
 * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
24
 * @ORM\HasLifecycleCallbacks()
25
 * @ORM\Entity(repositoryClass="Eccube\Repository\TemplateRepository")
26
 */
27
class Template extends \Eccube\Entity\AbstractEntity
28
{
29
    /**
30
     *  初期テンプレートコード
31
     */
32
    const DEFAULT_TEMPLATE_CODE = 'default';
33
34
    /**
35
     * @return bool
36
     */
37
    public function isDefaultTemplate()
38
    {
39
        return self::DEFAULT_TEMPLATE_CODE === $this->getCode();
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function __toString()
46
    {
47
        return (string) $this->getName();
48
    }
49
50
    /**
51
     * @var int
52
     *
53
     * @ORM\Column(name="id", type="integer", options={"unsigned":true})
54
     * @ORM\Id
55
     * @ORM\GeneratedValue(strategy="IDENTITY")
56
     */
57
    private $id;
58
59
    /**
60
     * @var string
61
     *
62
     * @ORM\Column(name="template_code", type="string", length=255)
63
     */
64
    private $code;
65
66
    /**
67
     * @var string
68
     *
69
     * @ORM\Column(name="template_name", type="string", length=255)
70
     */
71
    private $name;
72
73
    /**
74
     * @var \DateTime
75
     *
76
     * @ORM\Column(name="create_date", type="datetimetz")
77
     */
78
    private $create_date;
79
80
    /**
81
     * @var \DateTime
82
     *
83
     * @ORM\Column(name="update_date", type="datetimetz")
84
     */
85
    private $update_date;
86
87
    /**
88
     * @var \Eccube\Entity\Master\DeviceType
89
     *
90
     * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType")
91
     * @ORM\JoinColumns({
92
     *   @ORM\JoinColumn(name="device_type_id", referencedColumnName="id")
93
     * })
94
     */
95
    private $DeviceType;
96
97
    /**
98
     * Get id.
99
     *
100
     * @return int
101
     */
102
    public function getId()
103
    {
104
        return $this->id;
105
    }
106
107
    /**
108
     * Set code.
109
     *
110
     * @param string $code
111
     *
112
     * @return Template
113
     */
114
    public function setCode($code)
115
    {
116
        $this->code = $code;
117
118
        return $this;
119
    }
120
121
    /**
122
     * Get code.
123
     *
124
     * @return string
125
     */
126
    public function getCode()
127
    {
128
        return $this->code;
129
    }
130
131
    /**
132
     * Set name.
133
     *
134
     * @param string $name
135
     *
136
     * @return Template
137
     */
138
    public function setName($name)
139
    {
140
        $this->name = $name;
141
142
        return $this;
143
    }
144
145
    /**
146
     * Get name.
147
     *
148
     * @return string
149
     */
150
    public function getName()
151
    {
152
        return $this->name;
153
    }
154
155
    /**
156
     * Set createDate.
157
     *
158
     * @param \DateTime $createDate
159
     *
160
     * @return Template
161
     */
162
    public function setCreateDate($createDate)
163
    {
164
        $this->create_date = $createDate;
165
166
        return $this;
167
    }
168
169
    /**
170
     * Get createDate.
171
     *
172
     * @return \DateTime
173
     */
174
    public function getCreateDate()
175
    {
176
        return $this->create_date;
177
    }
178
179
    /**
180
     * Set updateDate.
181
     *
182
     * @param \DateTime $updateDate
183
     *
184
     * @return Template
185
     */
186
    public function setUpdateDate($updateDate)
187
    {
188
        $this->update_date = $updateDate;
189
190
        return $this;
191
    }
192
193
    /**
194
     * Get updateDate.
195
     *
196
     * @return \DateTime
197
     */
198
    public function getUpdateDate()
199
    {
200
        return $this->update_date;
201
    }
202
203
    /**
204
     * Set deviceType.
205
     *
206
     * @param \Eccube\Entity\Master\DeviceType|null $deviceType
207
     *
208
     * @return Template
209
     */
210
    public function setDeviceType(\Eccube\Entity\Master\DeviceType $deviceType = null)
211
    {
212
        $this->DeviceType = $deviceType;
213
214
        return $this;
215
    }
216
217
    /**
218
     * Get deviceType.
219
     *
220
     * @return \Eccube\Entity\Master\DeviceType|null
221
     */
222
    public function getDeviceType()
223
    {
224
        return $this->DeviceType;
225
    }
226
}
227