1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
AbstractOption.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
14
15abstract class AbstractOption implements CreateObjectInterface
16{
18
19 protected string $name;
20 protected string $value;
21
25 public static function create(mixed $data): static
26 {
27 $name = array_key_first($data);
29
31 }
32
33 public function __construct(string $name, string $value)
34 {
35 $this->name = $name;
36 $this->value = $value;
37
38 $this->init();
39 }
40
41 abstract protected function applyImplementation(Collab $collab): Result;
42
43 public function apply(int $collabId): Result
44 {
45 $result = new Result();
46
47 $collab = $this->provider->disableCache()->getCollab($collabId);
48 if ($collab === null)
49 {
50 $result->addError(new Error('Collab not found'));
51
52 return $result;
53 }
54
55 return $this->applyImplementation($collab);
56 }
57
58 public function getName(): string
59 {
60 return $this->name;
61 }
62
63 public function getValue(): string
64 {
65 return $this->value;
66 }
67
68 protected function init(): void
69 {
70 $this->provider = CollabProvider::getInstance();
71 }
72}
Определения error.php:15
__construct(string $name, string $value)
Определения AbstractOption.php:33
static createOption(string $name, string $value,)
Определения OptionFactory.php:32
$data['IS_AVAILABLE']
Определения .description.php:13
$result
Определения get_property_values.php:14