Completed
Push — experimental/sf ( 088e42...fc9b4d )
by Kiyotaka
363:35 queued 321:24
created

BlockPosition::getPage()   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
ccs 0
cts 2
cp 0
crap 2
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 1
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="page_id", type="integer", options={"unsigned":true}, nullable=true)
34
         *
35
         * @deprecated
36
         */
37
        private $page_id;
38
39
        /**
40
         * @var int
41
         *
42
         * @ORM\Column(name="section", type="integer", options={"unsigned":true})
43
         * @ORM\Id
44
         * @ORM\GeneratedValue(strategy="NONE")
45
         */
46
        private $section;
47
48
        /**
49
         * @var int
50
         *
51
         * @ORM\Column(name="block_id", type="integer", options={"unsigned":true})
52
         * @ORM\Id
53
         * @ORM\GeneratedValue(strategy="NONE")
54
         */
55
        private $block_id;
56
57
        /**
58
         * @var int
59
         *
60
         * @ORM\Column(name="layout_id", type="integer", options={"unsigned":true})
61
         * @ORM\Id
62
         * @ORM\GeneratedValue(strategy="NONE")
63
         */
64
        private $layout_id;
65
66
        /**
67
         * @var int|null
68
         *
69
         * @ORM\Column(name="block_row", type="integer", nullable=true, options={"unsigned":true})
70
         */
71
        private $block_row;
72
73
        /**
74
         * @var int
75
         *
76
         * @ORM\Column(name="anywhere", type="smallint", options={"default":0})
77
         *
78
         * @deprecated
79
         */
80
        private $anywhere = 0;
81
82
        /**
83
         * @var \Eccube\Entity\Block
84
         *
85
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Block", inversedBy="BlockPositions")
86
         * @ORM\JoinColumns({
87
         *   @ORM\JoinColumn(name="block_id", referencedColumnName="id")
88
         * })
89
         */
90
        private $Block;
91
92
        /**
93
         * @var \Eccube\Entity\PageLayout
94
         *
95
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Page", inversedBy="BlockPositions")
96
         * @ORM\JoinColumns({
97
         *   @ORM\JoinColumn(name="page_id", referencedColumnName="id")
98
         * })
99
         *
100
         * @deprecated
101
         */
102
        private $Page;
103
104
        /**
105
         * @var \Eccube\Entity\Layout
106
         *
107
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Layout", inversedBy="BlockPositions")
108
         * @ORM\JoinColumns({
109
         *   @ORM\JoinColumn(name="layout_id", referencedColumnName="id")
110
         * })
111
         */
112
        private $Layout;
113
114
        /**
115
         * Set pageId.
116
         *
117
         * @param int $pageId
118
         *
119
         * @return BlockPosition
120
         *
121
         * @deprecated
122
         */
123
        public function setPageId($pageId)
124
        {
125
            $this->page_id = $pageId;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\BlockPosition::$page_id has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
126
127
            return $this;
128
        }
129
130
        /**
131
         * Get pageId.
132
         *
133
         * @return int
134
         *
135
         * @deprecated
136
         */
137
        public function getPageId()
138
        {
139
            return $this->page_id;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\BlockPosition::$page_id has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
140
        }
141
142
        /**
143
         * Set section.
144
         *
145
         * @param int $section
146
         *
147
         * @return BlockPosition
148
         */
149 1
        public function setSection($section)
150
        {
151 1
            $this->section = $section;
152
153 1
            return $this;
154
        }
155
156
        /**
157
         * Get section.
158
         *
159
         * @return int
160
         */
161 113
        public function getSection()
162
        {
163 113
            return $this->section;
164
        }
165
166
        /**
167
         * Set blockId.
168
         *
169
         * @param int $blockId
170
         *
171
         * @return BlockPosition
172
         */
173 1
        public function setBlockId($blockId)
174
        {
175 1
            $this->block_id = $blockId;
176
177 1
            return $this;
178
        }
179
180
        /**
181
         * Get blockId.
182
         *
183
         * @return int
184
         */
185
        public function getBlockId()
186
        {
187
            return $this->block_id;
188
        }
189
190
        /**
191
         * Set layoutId.
192
         *
193
         * @param int $layoutId
194
         *
195
         * @return BlockPosition
196
         */
197 1
        public function setLayoutId($layoutId)
198
        {
199 1
            $this->layout_id = $layoutId;
200
201 1
            return $this;
202
        }
203
204
        /**
205
         * Get layoutId.
206
         *
207
         * @return int
208
         */
209
        public function getLayoutId()
210
        {
211
            return $this->layout_id;
212
        }
213
214
        /**
215
         * Set blockRow.
216
         *
217
         * @param int|null $blockRow
218
         *
219
         * @return BlockPosition
220
         */
221 1
        public function setBlockRow($blockRow = null)
222
        {
223 1
            $this->block_row = $blockRow;
224
225 1
            return $this;
226
        }
227
228
        /**
229
         * Get blockRow.
230
         *
231
         * @return int|null
232
         */
233
        public function getBlockRow()
234
        {
235
            return $this->block_row;
236
        }
237
238
        /**
239
         * Set anywhere.
240
         *
241
         * @param int $anywhere
242
         *
243
         * @return BlockPosition
244
         *
245
         * @deprecated
246
         */
247
        public function setAnywhere($anywhere)
248
        {
249
            $this->anywhere = $anywhere;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\BlockPosition::$anywhere has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
250
251
            return $this;
252
        }
253
254
        /**
255
         * Get anywhere.
256
         *
257
         * @return int
258
         *
259
         * @deprecated
260
         */
261
        public function getAnywhere()
262
        {
263
            return $this->anywhere;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\BlockPosition::$anywhere has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
264
        }
265
266
        /**
267
         * Set block.
268
         *
269
         * @param \Eccube\Entity\Block|null $block
270
         *
271
         * @return BlockPosition
272
         */
273 1
        public function setBlock(\Eccube\Entity\Block $block = null)
274
        {
275 1
            $this->Block = $block;
276
277 1
            return $this;
278
        }
279
280
        /**
281
         * Get block.
282
         *
283
         * @return \Eccube\Entity\Block|null
284
         */
285 117
        public function getBlock()
286
        {
287 117
            return $this->Block;
288
        }
289
290
        /**
291
         * Set layout.
292
         *
293
         * @param \Eccube\Entity\Layout|null $Layout
294
         *
295
         * @return BlockPosition
296
         */
297 1
        public function setLayout(\Eccube\Entity\Layout $Layout = null)
298
        {
299 1
            $this->Layout = $Layout;
300
301 1
            return $this;
302
        }
303
304
        /**
305
         * Get Layout.
306
         *
307
         * @return \Eccube\Entity\Layout|null
308
         */
309
        public function getLayout()
310
        {
311
            return $this->Layout;
312
        }
313
314
        /**
315
         * Set pageLayout.
316
         *
317
         * @param \Eccube\Entity\Page|null $Page
318
         *
319
         * @return BlockPosition
320
         *
321
         * @deprecated
322
         */
323
        public function setPage(\Eccube\Entity\Page $Page = null)
324
        {
325
            $this->Page = $Page;
0 ignored issues
show
Documentation Bug introduced by
It seems like $Page can also be of type object<Eccube\Entity\Page>. However, the property $Page is declared as type object<Eccube\Entity\PageLayout>. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
Deprecated Code introduced by
The property Eccube\Entity\BlockPosition::$Page has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
326
327
            return $this;
328
        }
329
330
        /**
331
         * Get pageLayout.
332
         *
333
         * @return PageLayout
334
         *
335
         * @deprecated
336
         */
337
        public function getPage()
338
        {
339
            return $this->Page;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\BlockPosition::$Page has been deprecated.

This property has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.

Loading history...
340
        }
341
    }
342
}
343