1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
CollabEntity.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
11
15abstract class CollabEntity
16{
18 protected Collab $collab;
19
20 protected int $id;
21
25 public function __construct(int $id, mixed $internalObject = null)
26 {
27 if ($id <= 0)
28 {
29 throw new ObjectException("Entity {$this->getType()->value}:{$this->id} doesn't exist");
30 }
31
32 $this->id = $id;
33
34 $this->init();
35
36 if (!$this->checkInternalEntity())
37 {
38 throw new ObjectException("Entity {$this->getType()->value}:{$this->id} not found");
39 }
40
41 $collab = $this->fillCollab();
42 if ($collab === null)
43 {
44 throw new ObjectException("Entity {$this->getType()->value}:{$this->id} is not in collab");
45 }
46
47 $this->collab = $collab;
48 }
49
50 abstract public function getType(): EntityType;
51
52 abstract public function getData(): array;
53
54 abstract protected function fillCollab(): ?Collab;
55
56 abstract protected function checkInternalEntity(): bool;
57
58 public function getCollab(): Collab
59 {
60 return $this->collab;
61 }
62
63 public function getId(): int
64 {
65 return $this->id;
66 }
67
68 protected function init(): void
69 {
70 $this->collabRegistry = CollabRegistry::getInstance();
71 }
72}
__construct(int $id, mixed $internalObject=null)
Определения CollabEntity.php:25
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804