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

Page::setDescription()   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
rs 10
c 0
b 0
f 0
ccs 3
cts 3
cp 1
crap 1
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
 * Page
20
 *
21
 * @ORM\Table(name="dtb_page", indexes={@ORM\Index(name="dtb_page_url_idx", columns={"url"})})
22
 * @ORM\InheritanceType("SINGLE_TABLE")
23
 * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
24
 * @ORM\HasLifecycleCallbacks()
25
 * @ORM\Entity(repositoryClass="Eccube\Repository\PageRepository")
26
 */
27
class Page extends \Eccube\Entity\AbstractEntity
28
{
29
    // 配置ID
30
    /** 配置ID: 未使用 */
31
    const TARGET_ID_UNUSED = 0;
32
    const TARGET_ID_HEAD = 1;
33
    const TARGET_ID_BODY_AFTER = 2;
34
    const TARGET_ID_HEADER = 3;
35
    const TARGET_ID_CONTENTS_TOP = 4;
36
    const TARGET_ID_SIDE_LEFT = 5;
37
    const TARGET_ID_MAIN_TOP = 6;
38
    const TARGET_ID_MAIN_BOTTOM = 7;
39
    const TARGET_ID_SIDE_RIGHT = 8;
40
    const TARGET_ID_CONTENTS_BOTTOM = 9;
41
    const TARGET_ID_FOOTER = 10;
42
    const TARGET_ID_DRAWER = 11;
43
    const TARGET_ID_CLOSE_BODY_BEFORE = 12;
44
45
    // 編集可能フラグ
46
    const EDIT_TYPE_USER = 0;
47
    const EDIT_TYPE_PREVIEW = 1;
48
    const EDIT_TYPE_DEFAULT = 2;
49
50 147
    public function getLayouts()
51
    {
52 147
        $Layouts = [];
53 147
        foreach ($this->PageLayouts as $PageLayout) {
54 116
            $Layouts[] = $PageLayout->getLayout();
55
        }
56
57 147
        return $Layouts;
58
    }
59
60
    /**
61
     * Get ColumnNum
62
     *
63
     * @return integer
64
     */
65 113
    public function getColumnNum()
66
    {
67 113
        return 1 + ($this->getSideLeft() ? 1 : 0) + ($this->getSideRight() ? 1 : 0);
68
    }
69
70
    public function getTheme()
71
    {
72
        $hasLeft = $this->getSideLeft() ? true : false;
73
        $hasRight = $this->getSideRight() ? true : false;
74
75
        $theme = 'theme_main_only';
76
        if ($hasLeft && $hasRight) {
77
            $theme = 'theme_side_both';
78
        } elseif ($hasLeft) {
79
            $theme = 'theme_side_left';
80
        } elseif ($hasRight) {
81
            $theme = 'theme_side_right';
82
        }
83
84
        return $theme;
85
    }
86
87
    /**
88
     * Get BlockPositionByTargetId
89
     *
90
     * @param integer $target_id
91
     *
92
     * @return array
93
     */
94
    public function getBlocksPositionByTargetId($target_id)
95
    {
96
        $BlockPositions = [];
97
        foreach ($this->getBlockPositions() as $BlockPosition) {
98
            if ($BlockPosition->getSection() === $target_id) {
99
                $BlockPositions[] = $BlockPosition;
100
            }
101
        }
102
103
        return $BlockPositions;
104
    }
105
106
    /**
107
     * @deprecated
108
     *
109
     * @return BlockPosition
110
     */
111
    public function getUnusedPosition()
112
    {
113
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_UNUSED);
114
    }
115
116
    /**
117
     * @deprecated
118
     *
119
     * @return BlockPosition
120
     */
121
    public function getHeadPosition()
122
    {
123
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_HEAD);
124
    }
125
126
    /**
127
     * @deprecated
128
     *
129
     * @return BlockPosition
130
     */
131
    public function getHeaderPosition()
132
    {
133
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_HEADER);
134
    }
135
136
    /**
137
     * @deprecated
138
     *
139
     * @return BlockPosition
140
     */
141
    public function getContentsTopPosition()
142
    {
143
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_CONTENTS_TOP);
144
    }
145
146
    /**
147
     * @deprecated
148
     *
149
     * @return BlockPosition
150
     */
151
    public function getSideLeftPosition()
152
    {
153
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_SIDE_LEFT);
154
    }
155
156
    /**
157
     * @deprecated
158
     *
159
     * @return BlockPosition
160
     */
161
    public function getMainTopPosition()
162
    {
163
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_MAIN_TOP);
164
    }
165
166
    /**
167
     * @deprecated
168
     *
169
     * @return BlockPosition
170
     */
171
    public function getMainBottomPosition()
172
    {
173
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_MAIN_BOTTOM);
174
    }
175
176
    /**
177
     * @deprecated
178
     *
179
     * @return BlockPosition
180
     */
181
    public function getSideRightPosition()
182
    {
183
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_SIDE_RIGHT);
184
    }
185
186
    /**
187
     * @deprecated
188
     *
189
     * @return BlockPosition
190
     */
191
    public function getContentsBottomPosition()
192
    {
193
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_CONTENTS_BOTTOM);
194
    }
195
196
    public function getFooterPosition()
197
    {
198
        return $this->getBlocksPositionByTargetId(self::TARGET_ID_FOOTER);
199
    }
200
201
    /**
202
     * @deprecated
203
     *
204
     * Get BlocsByTargetId
205
     *
206
     * @param integer $target_id
207
     *
208
     * @return \Eccube\Entity\Block[]
209
     */
210
    public function getBlocksByTargetId($target_id)
211
    {
212
        $Blocks = [];
213
        foreach ($this->getBlockPositions() as $BlockPositions) {
214
            if ($BlockPositions->getTargetId() === $target_id) {
215
                $Blocks[] = $BlockPositions->getBlock();
216
            }
217
        }
218
219
        return $Blocks;
220
    }
221
222
    public function getUnused()
223
    {
224
        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...
225
    }
226
227 113
    public function getHead()
228
    {
229 113
        $Layout = current($this->getLayouts());
230
231 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_HEAD) : [];
232
    }
233
234 113
    public function getBodyAfter()
235
    {
236 113
        $Layout = current($this->getLayouts());
237
238 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_BODY_AFTER) : [];
239
    }
240
241 113
    public function getHeader()
242
    {
243 113
        $Layout = current($this->getLayouts());
244
245 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_HEADER) : [];
246
    }
247
248 113
    public function getContentsTop()
249
    {
250 113
        $Layout = current($this->getLayouts());
251
252 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_CONTENTS_TOP) : [];
253
    }
254
255 113
    public function getSideLeft()
256
    {
257 113
        $Layout = current($this->getLayouts());
258
259 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_SIDE_LEFT) : [];
260
    }
261
262 113
    public function getMainTop()
263
    {
264 113
        $Layout = current($this->getLayouts());
265
266 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_MAIN_TOP) : [];
267
    }
268
269 113
    public function getMainBottom()
270
    {
271 113
        $Layout = current($this->getLayouts());
272
273 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_MAIN_BOTTOM) : [];
274
    }
275
276 113
    public function getSideRight()
277
    {
278 113
        $Layout = current($this->getLayouts());
279
280 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_SIDE_RIGHT) : [];
281
    }
282
283 113
    public function getContentsBottom()
284
    {
285 113
        $Layout = current($this->getLayouts());
286
287 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_CONTENTS_BOTTOM) : [];
288
    }
289
290 113
    public function getFooter()
291
    {
292 113
        $Layout = current($this->getLayouts());
293
294 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_FOOTER) : [];
295
    }
296
297 113
    public function getDrawer()
298
    {
299 113
        $Layout = current($this->getLayouts());
300
301 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_DRAWER) : [];
302
    }
303
304 113
    public function getCloseBodyBefore()
305
    {
306 113
        $Layout = current($this->getLayouts());
307
308 113
        return $Layout ? $Layout->getBlocks(self::TARGET_ID_CLOSE_BODY_BEFORE) : [];
309
    }
310
311
    /**
312
     * @var int
313
     *
314
     * @ORM\Column(name="id", type="integer", options={"unsigned":true})
315
     * @ORM\Id
316
     * @ORM\GeneratedValue(strategy="IDENTITY")
317
     */
318
    private $id;
319
320
    /**
321
     * @var string|null
322
     *
323
     * @ORM\Column(name="page_name", type="string", length=255, nullable=true)
324
     */
325
    private $name;
326
327
    /**
328
     * @var string
329
     *
330
     * @ORM\Column(name="url", type="string", length=255)
331
     */
332
    private $url;
333
334
    /**
335
     * @var string|null
336
     *
337
     * @ORM\Column(name="file_name", type="string", length=255, nullable=true)
338
     */
339
    private $file_name;
340
341
    /**
342
     * @var int
343
     *
344
     * @ORM\Column(name="edit_type", type="smallint", options={"unsigned":true,"default":1})
345
     */
346
    private $edit_type = 1;
347
348
    /**
349
     * @var string|null
350
     *
351
     * @ORM\Column(name="author", type="string", length=255, nullable=true)
352
     */
353
    private $author;
354
355
    /**
356
     * @var string|null
357
     *
358
     * @ORM\Column(name="description", type="string", length=255, nullable=true)
359
     */
360
    private $description;
361
362
    /**
363
     * @var string|null
364
     *
365
     * @ORM\Column(name="keyword", type="string", length=255, nullable=true)
366
     */
367
    private $keyword;
368
369
    /**
370
     * @var string|null
371
     *
372
     * @ORM\Column(name="update_url", type="string", length=255, nullable=true)
373
     */
374
    private $update_url;
375
376
    /**
377
     * @var \DateTime
378
     *
379
     * @ORM\Column(name="create_date", type="datetimetz")
380
     */
381
    private $create_date;
382
383
    /**
384
     * @var \DateTime
385
     *
386
     * @ORM\Column(name="update_date", type="datetimetz")
387
     */
388
    private $update_date;
389
390
    /**
391
     * @var string|null
392
     *
393
     * @ORM\Column(name="meta_robots", type="string", length=255, nullable=true)
394
     */
395
    private $meta_robots;
396
397
    /**
398
     * @var string|null
399
     *
400
     * @ORM\Column(name="meta_tags", type="string", length=4000, nullable=true)
401
     */
402
    private $meta_tags;
403
404
    /**
405
     * @var \Doctrine\Common\Collections\Collection
406
     *
407
     * @ORM\OneToMany(targetEntity="Eccube\Entity\BlockPosition", mappedBy="Page", cascade={"persist","remove"})
408
     *
409
     * @deprecated
410
     */
411
    private $BlockPositions;
412
413
    /**
414
     * @var \Doctrine\Common\Collections\Collection
415
     *
416
     * @ORM\OneToMany(targetEntity="Eccube\Entity\PageLayout", mappedBy="Page", cascade={"persist","remove"})
417
     */
418
    private $PageLayouts;
419
420
    /**
421
     * @var \Eccube\Entity\Master\DeviceType
422
     *
423
     * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\DeviceType")
424
     * @ORM\JoinColumns({
425
     *   @ORM\JoinColumn(name="device_type_id", referencedColumnName="id")
426
     * })
427
     */
428
    private $DeviceType;
429
430
    /**
431
     * @var \Eccube\Entity\Page
432
     *
433
     * @ORM\ManyToOne(targetEntity="Eccube\Entity\Page")
434
     * @ORM\JoinColumns({
435
     *   @ORM\JoinColumn(name="master_page_id", referencedColumnName="id")
436
     * })
437
     */
438
    private $MasterPage;
439
440
    /**
441
     * Constructor
442
     */
443 127
    public function __construct()
444
    {
445 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...
446 127
        $this->PageLayouts = new \Doctrine\Common\Collections\ArrayCollection();
447
    }
448
449
    /**
450
     * Set id
451
     *
452
     * @return Page
453
     */
454
    public function setId($id)
455
    {
456
        $this->id = $id;
457
458
        return $this;
459
    }
460
461
    /**
462
     * Get id
463
     *
464
     * @return integer
465
     */
466 41
    public function getId()
467
    {
468 41
        return $this->id;
469
    }
470
471
    /**
472
     * Set name.
473
     *
474
     * @param string|null $name
475
     *
476
     * @return Page
477
     */
478 34
    public function setName($name = null)
479
    {
480 34
        $this->name = $name;
481
482 34
        return $this;
483
    }
484
485
    /**
486
     * Get name.
487
     *
488
     * @return string|null
489
     */
490 186
    public function getName()
491
    {
492 186
        return $this->name;
493
    }
494
495
    /**
496
     * Set url.
497
     *
498
     * @param string $url
499
     *
500
     * @return Page
501
     */
502 37
    public function setUrl($url)
503
    {
504 37
        $this->url = $url;
505
506 37
        return $this;
507
    }
508
509
    /**
510
     * Get url.
511
     *
512
     * @return string
513
     */
514 36
    public function getUrl()
515
    {
516 36
        return $this->url;
517
    }
518
519
    /**
520
     * Set fileName.
521
     *
522
     * @param string|null $fileName
523
     *
524
     * @return Page
525
     */
526 35
    public function setFileName($fileName = null)
527
    {
528 35
        $this->file_name = $fileName;
529
530 35
        return $this;
531
    }
532
533
    /**
534
     * Get fileName.
535
     *
536
     * @return string|null
537
     */
538 36
    public function getFileName()
539
    {
540 36
        return $this->file_name;
541
    }
542
543
    /**
544
     * Set editType.
545
     *
546
     * @param int $editType
547
     *
548
     * @return Page
549
     */
550 126
    public function setEditType($editType)
551
    {
552 126
        $this->edit_type = $editType;
553
554 126
        return $this;
555
    }
556
557
    /**
558
     * Get editType.
559
     *
560
     * @return int
561
     */
562 5
    public function getEditType()
563
    {
564 5
        return $this->edit_type;
565
    }
566
567
    /**
568
     * Set author.
569
     *
570
     * @param string|null $author
571
     *
572
     * @return Page
573
     */
574 31
    public function setAuthor($author = null)
575
    {
576 31
        $this->author = $author;
577
578 31
        return $this;
579
    }
580
581
    /**
582
     * Get author.
583
     *
584
     * @return string|null
585
     */
586 147
    public function getAuthor()
587
    {
588 147
        return $this->author;
589
    }
590
591
    /**
592
     * Set description.
593
     *
594
     * @param string|null $description
595
     *
596
     * @return Page
597
     */
598 31
    public function setDescription($description = null)
599
    {
600 31
        $this->description = $description;
601
602 31
        return $this;
603
    }
604
605
    /**
606
     * Get description.
607
     *
608
     * @return string|null
609
     */
610 147
    public function getDescription()
611
    {
612 147
        return $this->description;
613
    }
614
615
    /**
616
     * Set keyword.
617
     *
618
     * @param string|null $keyword
619
     *
620
     * @return Page
621
     */
622 31
    public function setKeyword($keyword = null)
623
    {
624 31
        $this->keyword = $keyword;
625
626 31
        return $this;
627
    }
628
629
    /**
630
     * Get keyword.
631
     *
632
     * @return string|null
633
     */
634 147
    public function getKeyword()
635
    {
636 147
        return $this->keyword;
637
    }
638
639
    /**
640
     * Set updateUrl.
641
     *
642
     * @param string|null $updateUrl
643
     *
644
     * @return Page
645
     */
646
    public function setUpdateUrl($updateUrl = null)
647
    {
648
        $this->update_url = $updateUrl;
649
650
        return $this;
651
    }
652
653
    /**
654
     * Get updateUrl.
655
     *
656
     * @return string|null
657
     */
658
    public function getUpdateUrl()
659
    {
660
        return $this->update_url;
661
    }
662
663
    /**
664
     * Set createDate.
665
     *
666
     * @param \DateTime $createDate
667
     *
668
     * @return Page
669
     */
670 36
    public function setCreateDate($createDate)
671
    {
672 36
        $this->create_date = $createDate;
673
674 36
        return $this;
675
    }
676
677
    /**
678
     * Get createDate.
679
     *
680
     * @return \DateTime
681
     */
682
    public function getCreateDate()
683
    {
684
        return $this->create_date;
685
    }
686
687
    /**
688
     * Set updateDate.
689
     *
690
     * @param \DateTime $updateDate
691
     *
692
     * @return Page
693
     */
694 37
    public function setUpdateDate($updateDate)
695
    {
696 37
        $this->update_date = $updateDate;
697
698 37
        return $this;
699
    }
700
701
    /**
702
     * Get updateDate.
703
     *
704
     * @return \DateTime
705
     */
706
    public function getUpdateDate()
707
    {
708
        return $this->update_date;
709
    }
710
711
    /**
712
     * Set metaRobots.
713
     *
714
     * @param string|null $metaRobots
715
     *
716
     * @return Page
717
     */
718 31
    public function setMetaRobots($metaRobots = null)
719
    {
720 31
        $this->meta_robots = $metaRobots;
721
722 31
        return $this;
723
    }
724
725
    /**
726
     * Get metaRobots.
727
     *
728
     * @return string|null
729
     */
730 147
    public function getMetaRobots()
731
    {
732 147
        return $this->meta_robots;
733
    }
734
735
    /**
736
     * Set meta_tags
737
     *
738
     * @param string $metaTags
739
     *
740
     * @return Page
741
     */
742 31
    public function setMetaTags($metaTags)
743
    {
744 31
        $this->meta_tags = $metaTags;
745
746 31
        return $this;
747
    }
748
749
    /**
750
     * Get meta_tags
751
     *
752
     * @return string
753
     */
754 34
    public function getMetaTags()
755
    {
756 34
        return $this->meta_tags;
757
    }
758
759
    /**
760
     * Add blockPosition.
761
     *
762
     * @param \Eccube\Entity\BlockPosition $blockPosition
763
     *
764
     * @return Page
765
     */
766
    public function addBlockPosition(\Eccube\Entity\BlockPosition $blockPosition)
767
    {
768
        $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...
769
770
        return $this;
771
    }
772
773
    /**
774
     * Remove blockPosition.
775
     *
776
     * @param \Eccube\Entity\BlockPosition $blockPosition
777
     *
778
     * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
779
     */
780
    public function removeBlockPosition(\Eccube\Entity\BlockPosition $blockPosition)
781
    {
782
        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...
783
    }
784
785
    /**
786
     * Get pageLayoutLayout.
787
     *
788
     * @return \Doctrine\Common\Collections\Collection
789
     */
790 2
    public function getPageLayouts()
791
    {
792 2
        return $this->PageLayouts;
793
    }
794
795
    /**
796
     * Add pageLayoutLayout
797
     *
798
     * @param \Eccube\Entity\PageLayout $PageLayout
799
     *
800
     * @return Page
801
     */
802
    public function addPageLayout(\Eccube\Entity\PageLayout $PageLayout)
803
    {
804
        $this->PageLayouts[] = $PageLayout;
805
806
        return $this;
807
    }
808
809
    /**
810
     * Remove pageLayoutLayout
811
     *
812
     * @param \Eccube\Entity\PageLayout $PageLayout
813
     */
814 1
    public function removePageLayout(\Eccube\Entity\PageLayout $PageLayout)
815
    {
816 1
        $this->PageLayouts->removeElement($PageLayout);
817
    }
818
819
    /**
820
     * Get blockPositions.
821
     *
822
     * @return \Doctrine\Common\Collections\Collection
823
     */
824 6
    public function getBlockPositions()
825
    {
826 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...
827
    }
828
829
    /**
830
     * Set deviceType.
831
     *
832
     * @param \Eccube\Entity\Master\DeviceType|null $deviceType
833
     *
834
     * @return Page
835
     */
836 127
    public function setDeviceType(\Eccube\Entity\Master\DeviceType $deviceType = null)
837
    {
838 127
        $this->DeviceType = $deviceType;
839
840 127
        return $this;
841
    }
842
843
    /**
844
     * Get deviceType.
845
     *
846
     * @return \Eccube\Entity\Master\DeviceType|null
847
     */
848 34
    public function getDeviceType()
849
    {
850 34
        return $this->DeviceType;
851
    }
852
853
    /**
854
     * Set MasterPage.
855
     *
856
     * @param \Eccube\Entity\Page|null $page
857
     *
858
     * @return Page
859
     */
860
    public function setMasterPage(\Eccube\Entity\Page $page = null)
861
    {
862
        $this->MasterPage = $page;
863
864
        return $this;
865
    }
866
867
    /**
868
     * Get MasterPage.
869
     *
870
     * @return \Eccube\Entity\Page|null
871
     */
872 1
    public function getMasterPage()
873
    {
874 1
        return $this->MasterPage;
875
    }
876
877
    /**
878
     * @param $layoutId
879
     *
880
     * @return null|int
881
     */
882
    public function getSortNo($layoutId)
883
    {
884
        $pageLayouts = $this->getPageLayouts();
885
886
        /** @var PageLayout $pageLayout */
887
        foreach ($pageLayouts as $pageLayout) {
888
            if ($pageLayout->getLayoutId() == $layoutId) {
889
                return $pageLayout->getSortNo();
890
            }
891
        }
892
893
        return null;
894
    }
895
}
896