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
|
|
|
if (!class_exists('\Eccube\Entity\BlockPosition')) { |
19
|
|
|
/** |
20
|
|
|
* BlockPosition |
21
|
|
|
* |
22
|
|
|
* @ORM\Table(name="dtb_block_position") |
23
|
|
|
* @ORM\InheritanceType("SINGLE_TABLE") |
24
|
|
|
* @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255) |
25
|
|
|
* @ORM\HasLifecycleCallbacks() |
26
|
|
|
* @ORM\Entity(repositoryClass="Eccube\Repository\BlockPositionRepository") |
27
|
|
|
*/ |
28
|
|
|
class BlockPosition extends \Eccube\Entity\AbstractEntity |
29
|
|
|
{ |
30
|
|
|
/** |
31
|
|
|
* @var int |
32
|
|
|
* |
33
|
|
|
* @ORM\Column(name="section", type="integer", options={"unsigned":true}) |
34
|
|
|
* @ORM\Id |
35
|
|
|
* @ORM\GeneratedValue(strategy="NONE") |
36
|
|
|
*/ |
37
|
|
|
private $section; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var int |
41
|
|
|
* |
42
|
|
|
* @ORM\Column(name="block_id", type="integer", options={"unsigned":true}) |
43
|
|
|
* @ORM\Id |
44
|
|
|
* @ORM\GeneratedValue(strategy="NONE") |
45
|
|
|
*/ |
46
|
|
|
private $block_id; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var int |
50
|
|
|
* |
51
|
|
|
* @ORM\Column(name="layout_id", type="integer", options={"unsigned":true}) |
52
|
|
|
* @ORM\Id |
53
|
|
|
* @ORM\GeneratedValue(strategy="NONE") |
54
|
|
|
*/ |
55
|
|
|
private $layout_id; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var int|null |
59
|
|
|
* |
60
|
|
|
* @ORM\Column(name="block_row", type="integer", nullable=true, options={"unsigned":true}) |
61
|
|
|
*/ |
62
|
|
|
private $block_row; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var \Eccube\Entity\Block |
66
|
|
|
* |
67
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Block", inversedBy="BlockPositions") |
68
|
|
|
* @ORM\JoinColumns({ |
69
|
|
|
* @ORM\JoinColumn(name="block_id", referencedColumnName="id") |
70
|
|
|
* }) |
71
|
|
|
*/ |
72
|
|
|
private $Block; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var \Eccube\Entity\Layout |
76
|
|
|
* |
77
|
|
|
* @ORM\ManyToOne(targetEntity="Eccube\Entity\Layout", inversedBy="BlockPositions") |
78
|
|
|
* @ORM\JoinColumns({ |
79
|
|
|
* @ORM\JoinColumn(name="layout_id", referencedColumnName="id") |
80
|
|
|
* }) |
81
|
|
|
*/ |
82
|
|
|
private $Layout; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Set section. |
86
|
|
|
* |
87
|
|
|
* @param int $section |
88
|
|
|
* |
89
|
|
|
* @return BlockPosition |
90
|
|
|
*/ |
91
|
|
|
public function setSection($section) |
92
|
|
|
{ |
93
|
|
|
$this->section = $section; |
94
|
|
|
|
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Get section. |
100
|
|
|
* |
101
|
|
|
* @return int |
102
|
|
|
*/ |
103
|
|
|
public function getSection() |
104
|
|
|
{ |
105
|
|
|
return $this->section; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* Set blockId. |
110
|
|
|
* |
111
|
|
|
* @param int $blockId |
112
|
|
|
* |
113
|
|
|
* @return BlockPosition |
114
|
|
|
*/ |
115
|
|
|
public function setBlockId($blockId) |
116
|
|
|
{ |
117
|
|
|
$this->block_id = $blockId; |
118
|
|
|
|
119
|
|
|
return $this; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* Get blockId. |
124
|
|
|
* |
125
|
|
|
* @return int |
126
|
|
|
*/ |
127
|
|
|
public function getBlockId() |
128
|
|
|
{ |
129
|
|
|
return $this->block_id; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* Set layoutId. |
134
|
|
|
* |
135
|
|
|
* @param int $layoutId |
136
|
|
|
* |
137
|
|
|
* @return BlockPosition |
138
|
|
|
*/ |
139
|
|
|
public function setLayoutId($layoutId) |
140
|
|
|
{ |
141
|
|
|
$this->layout_id = $layoutId; |
142
|
|
|
|
143
|
|
|
return $this; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* Get layoutId. |
148
|
|
|
* |
149
|
|
|
* @return int |
150
|
|
|
*/ |
151
|
|
|
public function getLayoutId() |
152
|
|
|
{ |
153
|
|
|
return $this->layout_id; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* Set blockRow. |
158
|
|
|
* |
159
|
|
|
* @param int|null $blockRow |
160
|
|
|
* |
161
|
|
|
* @return BlockPosition |
162
|
|
|
*/ |
163
|
|
|
public function setBlockRow($blockRow = null) |
164
|
|
|
{ |
165
|
|
|
$this->block_row = $blockRow; |
166
|
|
|
|
167
|
|
|
return $this; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* Get blockRow. |
172
|
|
|
* |
173
|
|
|
* @return int|null |
174
|
|
|
*/ |
175
|
|
|
public function getBlockRow() |
176
|
|
|
{ |
177
|
|
|
return $this->block_row; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* Set block. |
182
|
|
|
* |
183
|
|
|
* @param \Eccube\Entity\Block|null $block |
184
|
|
|
* |
185
|
|
|
* @return BlockPosition |
186
|
|
|
*/ |
187
|
|
|
public function setBlock(\Eccube\Entity\Block $block = null) |
188
|
|
|
{ |
189
|
|
|
$this->Block = $block; |
190
|
|
|
|
191
|
|
|
return $this; |
192
|
|
|
} |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* Get block. |
196
|
|
|
* |
197
|
|
|
* @return \Eccube\Entity\Block|null |
198
|
|
|
*/ |
199
|
|
|
public function getBlock() |
200
|
|
|
{ |
201
|
|
|
return $this->Block; |
202
|
|
|
} |
203
|
|
|
|
204
|
|
|
/** |
205
|
|
|
* Set layout. |
206
|
|
|
* |
207
|
|
|
* @param \Eccube\Entity\Layout|null $Layout |
208
|
|
|
* |
209
|
|
|
* @return BlockPosition |
210
|
|
|
*/ |
211
|
|
|
public function setLayout(\Eccube\Entity\Layout $Layout = null) |
212
|
|
|
{ |
213
|
|
|
$this->Layout = $Layout; |
214
|
|
|
|
215
|
|
|
return $this; |
216
|
|
|
} |
217
|
|
|
|
218
|
|
|
/** |
219
|
|
|
* Get Layout. |
220
|
|
|
* |
221
|
|
|
* @return \Eccube\Entity\Layout|null |
222
|
|
|
*/ |
223
|
|
|
public function getLayout() |
224
|
|
|
{ |
225
|
|
|
return $this->Layout; |
226
|
|
|
} |
227
|
|
|
} |
228
|
|
|
} |
229
|
|
|
|