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

Page::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
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 1
if (!class_exists('\Eccube\Entity\Page')) {
19
    /**
20
     * Page
21
     *
22
     * @ORM\Table(name="dtb_page", indexes={@ORM\Index(name="dtb_page_url_idx", columns={"url"})})
23
     * @ORM\InheritanceType("SINGLE_TABLE")
24
     * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
25
     * @ORM\HasLifecycleCallbacks()
26
     * @ORM\Entity(repositoryClass="Eccube\Repository\PageRepository")
27
     */
28
    class Page extends \Eccube\Entity\AbstractEntity
29
    {
30
        // 配置ID
31
        /** 配置ID: 未使用 */
32
        const TARGET_ID_UNUSED = 0;
33
        const TARGET_ID_HEAD = 1;
34
        const TARGET_ID_BODY_AFTER = 2;
35
        const TARGET_ID_HEADER = 3;
36
        const TARGET_ID_CONTENTS_TOP = 4;
37
        const TARGET_ID_SIDE_LEFT = 5;
38
        const TARGET_ID_MAIN_TOP = 6;
39
        const TARGET_ID_MAIN_BOTTOM = 7;
40
        const TARGET_ID_SIDE_RIGHT = 8;
41
        const TARGET_ID_CONTENTS_BOTTOM = 9;
42
        const TARGET_ID_FOOTER = 10;
43
        const TARGET_ID_DRAWER = 11;
44
        const TARGET_ID_CLOSE_BODY_BEFORE = 12;
45
46
        // 編集可能フラグ
47
        const EDIT_TYPE_USER = 0;
48
        const EDIT_TYPE_PREVIEW = 1;
49
        const EDIT_TYPE_DEFAULT = 2;
50
51 147
        public function getLayouts()
52
        {
53 147
            $Layouts = [];
54 147
            foreach ($this->PageLayouts as $PageLayout) {
55 116
                $Layouts[] = $PageLayout->getLayout();
56
            }
57
58 147
            return $Layouts;
59
        }
60
61
        /**
62
         * Get ColumnNum
63
         *
64
         * @return integer
65
         */
66 113
        public function getColumnNum()
67
        {
68 113
            return 1 + ($this->getSideLeft() ? 1 : 0) + ($this->getSideRight() ? 1 : 0);
69
        }
70
71
        public function getTheme()
72
        {
73
            $hasLeft = $this->getSideLeft() ? true : false;
74
            $hasRight = $this->getSideRight() ? true : false;
75
76
            $theme = 'theme_main_only';
77
            if ($hasLeft && $hasRight) {
78
                $theme = 'theme_side_both';
79
            } elseif ($hasLeft) {
80
                $theme = 'theme_side_left';
81
            } elseif ($hasRight) {
82
                $theme = 'theme_side_right';
83
            }
84
85
            return $theme;
86
        }
87
88
        /**
89
         * Get BlockPositionByTargetId
90
         *
91
         * @param integer $target_id
92
         *
93
         * @return array
94
         */
95
        public function getBlocksPositionByTargetId($target_id)
96
        {
97
            $BlockPositions = [];
98
            foreach ($this->getBlockPositions() as $BlockPosition) {
99
                if ($BlockPosition->getSection() === $target_id) {
100
                    $BlockPositions[] = $BlockPosition;
101
                }
102
            }
103
104
            return $BlockPositions;
105
        }
106
107
        /**
108
         * @deprecated
109
         *
110
         * @return BlockPosition
111
         */
112
        public function getUnusedPosition()
113
        {
114
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_UNUSED);
115
        }
116
117
        /**
118
         * @deprecated
119
         *
120
         * @return BlockPosition
121
         */
122
        public function getHeadPosition()
123
        {
124
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_HEAD);
125
        }
126
127
        /**
128
         * @deprecated
129
         *
130
         * @return BlockPosition
131
         */
132
        public function getHeaderPosition()
133
        {
134
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_HEADER);
135
        }
136
137
        /**
138
         * @deprecated
139
         *
140
         * @return BlockPosition
141
         */
142
        public function getContentsTopPosition()
143
        {
144
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_CONTENTS_TOP);
145
        }
146
147
        /**
148
         * @deprecated
149
         *
150
         * @return BlockPosition
151
         */
152
        public function getSideLeftPosition()
153
        {
154
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_SIDE_LEFT);
155
        }
156
157
        /**
158
         * @deprecated
159
         *
160
         * @return BlockPosition
161
         */
162
        public function getMainTopPosition()
163
        {
164
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_MAIN_TOP);
165
        }
166
167
        /**
168
         * @deprecated
169
         *
170
         * @return BlockPosition
171
         */
172
        public function getMainBottomPosition()
173
        {
174
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_MAIN_BOTTOM);
175
        }
176
177
        /**
178
         * @deprecated
179
         *
180
         * @return BlockPosition
181
         */
182
        public function getSideRightPosition()
183
        {
184
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_SIDE_RIGHT);
185
        }
186
187
        /**
188
         * @deprecated
189
         *
190
         * @return BlockPosition
191
         */
192
        public function getContentsBottomPosition()
193
        {
194
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_CONTENTS_BOTTOM);
195
        }
196
197
        public function getFooterPosition()
198
        {
199
            return $this->getBlocksPositionByTargetId(self::TARGET_ID_FOOTER);
200
        }
201
202
        /**
203
         * @deprecated
204
         *
205
         * Get BlocsByTargetId
206
         *
207
         * @param integer $target_id
208
         *
209
         * @return \Eccube\Entity\Block[]
210
         */
211
        public function getBlocksByTargetId($target_id)
212
        {
213
            $Blocks = [];
214
            foreach ($this->getBlockPositions() as $BlockPositions) {
215
                if ($BlockPositions->getTargetId() === $target_id) {
216
                    $Blocks[] = $BlockPositions->getBlock();
217
                }
218
            }
219
220
            return $Blocks;
221
        }
222
223
        public function getUnused()
224
        {
225
            return $this->getBlocksByTargetId(self::TARGET_ID_UNUSED);
0 ignored issues
show
Deprecated Code introduced by
The method Eccube\Entity\Page::getBlocksByTargetId() has been deprecated with message: Get BlocsByTargetId

This method 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 method will be removed from the class and what other method or class to use instead.

Loading history...
226
        }
227
228 113
        public function getHead()
229
        {
230 113
            $Layout = current($this->getLayouts());
231
232 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_HEAD) : [];
233
        }
234
235 113
        public function getBodyAfter()
236
        {
237 113
            $Layout = current($this->getLayouts());
238
239 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_BODY_AFTER) : [];
240
        }
241
242 113
        public function getHeader()
243
        {
244 113
            $Layout = current($this->getLayouts());
245
246 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_HEADER) : [];
247
        }
248
249 113
        public function getContentsTop()
250
        {
251 113
            $Layout = current($this->getLayouts());
252
253 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_CONTENTS_TOP) : [];
254
        }
255
256 113
        public function getSideLeft()
257
        {
258 113
            $Layout = current($this->getLayouts());
259
260 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_SIDE_LEFT) : [];
261
        }
262
263 113
        public function getMainTop()
264
        {
265 113
            $Layout = current($this->getLayouts());
266
267 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_MAIN_TOP) : [];
268
        }
269
270 113
        public function getMainBottom()
271
        {
272 113
            $Layout = current($this->getLayouts());
273
274 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_MAIN_BOTTOM) : [];
275
        }
276
277 113
        public function getSideRight()
278
        {
279 113
            $Layout = current($this->getLayouts());
280
281 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_SIDE_RIGHT) : [];
282
        }
283
284 113
        public function getContentsBottom()
285
        {
286 113
            $Layout = current($this->getLayouts());
287
288 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_CONTENTS_BOTTOM) : [];
289
        }
290
291 113
        public function getFooter()
292
        {
293 113
            $Layout = current($this->getLayouts());
294
295 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_FOOTER) : [];
296
        }
297
298 113
        public function getDrawer()
299
        {
300 113
            $Layout = current($this->getLayouts());
301
302 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_DRAWER) : [];
303
        }
304
305 113
        public function getCloseBodyBefore()
306
        {
307 113
            $Layout = current($this->getLayouts());
308
309 113
            return $Layout ? $Layout->getBlocks(self::TARGET_ID_CLOSE_BODY_BEFORE) : [];
310
        }
311
312
        /**
313
         * @var int
314
         *
315
         * @ORM\Column(name="id", type="integer", options={"unsigned":true})
316
         * @ORM\Id
317
         * @ORM\GeneratedValue(strategy="IDENTITY")
318
         */
319
        private $id;
320
321
        /**
322
         * @var string|null
323
         *
324
         * @ORM\Column(name="page_name", type="string", length=255, nullable=true)
325
         */
326
        private $name;
327
328
        /**
329
         * @var string
330
         *
331
         * @ORM\Column(name="url", type="string", length=255)
332
         */
333
        private $url;
334
335
        /**
336
         * @var string|null
337
         *
338
         * @ORM\Column(name="file_name", type="string", length=255, nullable=true)
339
         */
340
        private $file_name;
341
342
        /**
343
         * @var int
344
         *
345
         * @ORM\Column(name="edit_type", type="smallint", options={"unsigned":true,"default":1})
346
         */
347
        private $edit_type = 1;
348
349
        /**
350
         * @var string|null
351
         *
352
         * @ORM\Column(name="author", type="string", length=255, nullable=true)
353
         */
354
        private $author;
355
356
        /**
357
         * @var string|null
358
         *
359
         * @ORM\Column(name="description", type="string", length=255, nullable=true)
360
         */
361
        private $description;
362
363
        /**
364
         * @var string|null
365
         *
366
         * @ORM\Column(name="keyword", type="string", length=255, nullable=true)
367
         */
368
        private $keyword;
369
370
        /**
371
         * @var string|null
372
         *
373
         * @ORM\Column(name="update_url", type="string", length=255, nullable=true)
374
         */
375
        private $update_url;
376
377
        /**
378
         * @var \DateTime
379
         *
380
         * @ORM\Column(name="create_date", type="datetimetz")
381
         */
382
        private $create_date;
383
384
        /**
385
         * @var \DateTime
386
         *
387
         * @ORM\Column(name="update_date", type="datetimetz")
388
         */
389
        private $update_date;
390
391
        /**
392
         * @var string|null
393
         *
394
         * @ORM\Column(name="meta_robots", type="string", length=255, nullable=true)
395
         */
396
        private $meta_robots;
397
398
        /**
399
         * @var string|null
400
         *
401
         * @ORM\Column(name="meta_tags", type="string", length=4000, nullable=true)
402
         */
403
        private $meta_tags;
404
405
        /**
406
         * @var \Doctrine\Common\Collections\Collection
407
         *
408
         * @ORM\OneToMany(targetEntity="Eccube\Entity\BlockPosition", mappedBy="Page", cascade={"persist","remove"})
409
         *
410
         * @deprecated
411
         */
412
        private $BlockPositions;
413
414
        /**
415
         * @var \Doctrine\Common\Collections\Collection
416
         *
417
         * @ORM\OneToMany(targetEntity="Eccube\Entity\PageLayout", mappedBy="Page", cascade={"persist","remove"})
418
         */
419
        private $PageLayouts;
420
421
        /**
422
         * @var \Eccube\Entity\Master\DeviceType
423
         *
424
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType")
425
         * @ORM\JoinColumns({
426
         *   @ORM\JoinColumn(name="device_type_id", referencedColumnName="id")
427
         * })
428
         */
429
        private $DeviceType;
430
431
        /**
432
         * @var \Eccube\Entity\Page
433
         *
434
         * @ORM\ManyToOne(targetEntity="Eccube\Entity\Page")
435
         * @ORM\JoinColumns({
436
         *   @ORM\JoinColumn(name="master_page_id", referencedColumnName="id")
437
         * })
438
         */
439
        private $MasterPage;
440
441
        /**
442
         * Constructor
443
         */
444 127
        public function __construct()
445
        {
446 127
            $this->BlockPositions = new \Doctrine\Common\Collections\ArrayCollection();
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\Page::$BlockPositions 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...
447 127
            $this->PageLayouts = new \Doctrine\Common\Collections\ArrayCollection();
448
        }
449
450
        /**
451
         * Set id
452
         *
453
         * @return Page
454
         */
455
        public function setId($id)
456
        {
457
            $this->id = $id;
458
459
            return $this;
460
        }
461
462
        /**
463
         * Get id
464
         *
465
         * @return integer
466
         */
467 41
        public function getId()
468
        {
469 41
            return $this->id;
470
        }
471
472
        /**
473
         * Set name.
474
         *
475
         * @param string|null $name
476
         *
477
         * @return Page
478
         */
479 34
        public function setName($name = null)
480
        {
481 34
            $this->name = $name;
482
483 34
            return $this;
484
        }
485
486
        /**
487
         * Get name.
488
         *
489
         * @return string|null
490
         */
491 186
        public function getName()
492
        {
493 186
            return $this->name;
494
        }
495
496
        /**
497
         * Set url.
498
         *
499
         * @param string $url
500
         *
501
         * @return Page
502
         */
503 37
        public function setUrl($url)
504
        {
505 37
            $this->url = $url;
506
507 37
            return $this;
508
        }
509
510
        /**
511
         * Get url.
512
         *
513
         * @return string
514
         */
515 36
        public function getUrl()
516
        {
517 36
            return $this->url;
518
        }
519
520
        /**
521
         * Set fileName.
522
         *
523
         * @param string|null $fileName
524
         *
525
         * @return Page
526
         */
527 35
        public function setFileName($fileName = null)
528
        {
529 35
            $this->file_name = $fileName;
530
531 35
            return $this;
532
        }
533
534
        /**
535
         * Get fileName.
536
         *
537
         * @return string|null
538
         */
539 36
        public function getFileName()
540
        {
541 36
            return $this->file_name;
542
        }
543
544
        /**
545
         * Set editType.
546
         *
547
         * @param int $editType
548
         *
549
         * @return Page
550
         */
551 126
        public function setEditType($editType)
552
        {
553 126
            $this->edit_type = $editType;
554
555 126
            return $this;
556
        }
557
558
        /**
559
         * Get editType.
560
         *
561
         * @return int
562
         */
563 5
        public function getEditType()
564
        {
565 5
            return $this->edit_type;
566
        }
567
568
        /**
569
         * Set author.
570
         *
571
         * @param string|null $author
572
         *
573
         * @return Page
574
         */
575 31
        public function setAuthor($author = null)
576
        {
577 31
            $this->author = $author;
578
579 31
            return $this;
580
        }
581
582
        /**
583
         * Get author.
584
         *
585
         * @return string|null
586
         */
587 147
        public function getAuthor()
588
        {
589 147
            return $this->author;
590
        }
591
592
        /**
593
         * Set description.
594
         *
595
         * @param string|null $description
596
         *
597
         * @return Page
598
         */
599 31
        public function setDescription($description = null)
600
        {
601 31
            $this->description = $description;
602
603 31
            return $this;
604
        }
605
606
        /**
607
         * Get description.
608
         *
609
         * @return string|null
610
         */
611 147
        public function getDescription()
612
        {
613 147
            return $this->description;
614
        }
615
616
        /**
617
         * Set keyword.
618
         *
619
         * @param string|null $keyword
620
         *
621
         * @return Page
622
         */
623 31
        public function setKeyword($keyword = null)
624
        {
625 31
            $this->keyword = $keyword;
626
627 31
            return $this;
628
        }
629
630
        /**
631
         * Get keyword.
632
         *
633
         * @return string|null
634
         */
635 147
        public function getKeyword()
636
        {
637 147
            return $this->keyword;
638
        }
639
640
        /**
641
         * Set updateUrl.
642
         *
643
         * @param string|null $updateUrl
644
         *
645
         * @return Page
646
         */
647
        public function setUpdateUrl($updateUrl = null)
648
        {
649
            $this->update_url = $updateUrl;
650
651
            return $this;
652
        }
653
654
        /**
655
         * Get updateUrl.
656
         *
657
         * @return string|null
658
         */
659
        public function getUpdateUrl()
660
        {
661
            return $this->update_url;
662
        }
663
664
        /**
665
         * Set createDate.
666
         *
667
         * @param \DateTime $createDate
668
         *
669
         * @return Page
670
         */
671 36
        public function setCreateDate($createDate)
672
        {
673 36
            $this->create_date = $createDate;
674
675 36
            return $this;
676
        }
677
678
        /**
679
         * Get createDate.
680
         *
681
         * @return \DateTime
682
         */
683
        public function getCreateDate()
684
        {
685
            return $this->create_date;
686
        }
687
688
        /**
689
         * Set updateDate.
690
         *
691
         * @param \DateTime $updateDate
692
         *
693
         * @return Page
694
         */
695 37
        public function setUpdateDate($updateDate)
696
        {
697 37
            $this->update_date = $updateDate;
698
699 37
            return $this;
700
        }
701
702
        /**
703
         * Get updateDate.
704
         *
705
         * @return \DateTime
706
         */
707
        public function getUpdateDate()
708
        {
709
            return $this->update_date;
710
        }
711
712
        /**
713
         * Set metaRobots.
714
         *
715
         * @param string|null $metaRobots
716
         *
717
         * @return Page
718
         */
719 31
        public function setMetaRobots($metaRobots = null)
720
        {
721 31
            $this->meta_robots = $metaRobots;
722
723 31
            return $this;
724
        }
725
726
        /**
727
         * Get metaRobots.
728
         *
729
         * @return string|null
730
         */
731 147
        public function getMetaRobots()
732
        {
733 147
            return $this->meta_robots;
734
        }
735
736
        /**
737
         * Set meta_tags
738
         *
739
         * @param string $metaTags
740
         *
741
         * @return Page
742
         */
743 31
        public function setMetaTags($metaTags)
744
        {
745 31
            $this->meta_tags = $metaTags;
746
747 31
            return $this;
748
        }
749
750
        /**
751
         * Get meta_tags
752
         *
753
         * @return string
754
         */
755 34
        public function getMetaTags()
756
        {
757 34
            return $this->meta_tags;
758
        }
759
760
        /**
761
         * Add blockPosition.
762
         *
763
         * @param \Eccube\Entity\BlockPosition $blockPosition
764
         *
765
         * @return Page
766
         */
767
        public function addBlockPosition(\Eccube\Entity\BlockPosition $blockPosition)
768
        {
769
            $this->BlockPositions[] = $blockPosition;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\Page::$BlockPositions 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...
770
771
            return $this;
772
        }
773
774
        /**
775
         * Remove blockPosition.
776
         *
777
         * @param \Eccube\Entity\BlockPosition $blockPosition
778
         *
779
         * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
780
         */
781
        public function removeBlockPosition(\Eccube\Entity\BlockPosition $blockPosition)
782
        {
783
            return $this->BlockPositions->removeElement($blockPosition);
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\Page::$BlockPositions 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...
784
        }
785
786
        /**
787
         * Get pageLayoutLayout.
788
         *
789
         * @return \Doctrine\Common\Collections\Collection
790
         */
791 2
        public function getPageLayouts()
792
        {
793 2
            return $this->PageLayouts;
794
        }
795
796
        /**
797
         * Add pageLayoutLayout
798
         *
799
         * @param \Eccube\Entity\PageLayout $PageLayout
800
         *
801
         * @return Page
802
         */
803
        public function addPageLayout(\Eccube\Entity\PageLayout $PageLayout)
804
        {
805
            $this->PageLayouts[] = $PageLayout;
806
807
            return $this;
808
        }
809
810
        /**
811
         * Remove pageLayoutLayout
812
         *
813
         * @param \Eccube\Entity\PageLayout $PageLayout
814
         */
815 1
        public function removePageLayout(\Eccube\Entity\PageLayout $PageLayout)
816
        {
817 1
            $this->PageLayouts->removeElement($PageLayout);
818
        }
819
820
        /**
821
         * Get blockPositions.
822
         *
823
         * @return \Doctrine\Common\Collections\Collection
824
         */
825 6
        public function getBlockPositions()
826
        {
827 6
            return $this->BlockPositions;
0 ignored issues
show
Deprecated Code introduced by
The property Eccube\Entity\Page::$BlockPositions 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...
828
        }
829
830
        /**
831
         * Set deviceType.
832
         *
833
         * @param \Eccube\Entity\Master\DeviceType|null $deviceType
834
         *
835
         * @return Page
836
         */
837 127
        public function setDeviceType(\Eccube\Entity\Master\DeviceType $deviceType = null)
838
        {
839 127
            $this->DeviceType = $deviceType;
840
841 127
            return $this;
842
        }
843
844
        /**
845
         * Get deviceType.
846
         *
847
         * @return \Eccube\Entity\Master\DeviceType|null
848
         */
849 34
        public function getDeviceType()
850
        {
851 34
            return $this->DeviceType;
852
        }
853
854
        /**
855
         * Set MasterPage.
856
         *
857
         * @param \Eccube\Entity\Page|null $page
858
         *
859
         * @return Page
860
         */
861
        public function setMasterPage(\Eccube\Entity\Page $page = null)
862
        {
863
            $this->MasterPage = $page;
864
865
            return $this;
866
        }
867
868
        /**
869
         * Get MasterPage.
870
         *
871
         * @return \Eccube\Entity\Page|null
872
         */
873
        public function getMasterPage()
874
        {
875
            return $this->MasterPage;
876
        }
877
878
        /**
879
         * @param $layoutId
880
         *
881
         * @return null|int
882
         */
883
        public function getSortNo($layoutId)
884
        {
885
            $pageLayouts = $this->getPageLayouts();
886
887
            /** @var PageLayout $pageLayout */
888
            foreach ($pageLayouts as $pageLayout) {
889
                if ($pageLayout->getLayoutId() == $layoutId) {
890
                    return $pageLayout->getSortNo();
891
                }
892
            }
893
894
            return null;
895
        }
896
    }
897
}
898