Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
categorybuilder.php
1<?php
2
4
7
8abstract class CategoryBuilder implements Builder
9{
10 private Category $category;
11
15 public function build(): Category
16 {
17 return
18 $this
19 ->getBaseCategory()
20 ->setId($this->getId())
21 ->setName($this->getName())
22 ->setRooms($this->getRooms())
23 ;
24 }
25
26 abstract protected function getId();
27 abstract protected function getName();
28 abstract protected function getRooms();
29
30 protected function getBaseCategory(): Category
31 {
32 if(empty($this->category))
33 {
34 $this->category = new Category();
35 }
36
37 return $this->category;
38 }
39}