1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Features.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Control\Command\ValueObject;
6
7use Bitrix\Socialnetwork\ValueObjectInterface;
8use CSocNetAllowed;
9
11{
12 protected array $features = [];
13
14 public static function create(mixed $data): static
15 {
16 $value = new static();
17
18 foreach ($data as $featureName => $isActive)
19 {
20 $value->features[$featureName] = $isActive;
21 }
22
23 return $value;
24 }
25
26 public static function createWithDefaultValue(): static
27 {
28 $value = new static();
29
30 $allowedFeatures = array_keys(CSocNetAllowed::getAllowedFeatures());
31 $inactiveFeaturesList = ['forum', 'photo', 'search', 'group_lists', 'wiki'];
32
33 foreach ($allowedFeatures as $featureName)
34 {
35 $value->features[$featureName] = !in_array($featureName, $inactiveFeaturesList, true);
36 }
37
38 return $value;
39 }
40
41 public function add(string $featureName): static
42 {
43 $this->features[$featureName] = $featureName;
44
45 return $this;
46 }
47
48 public function delete(string $featureName): static
49 {
50 unset($this->features[$featureName]);
51
52 return $this;
53 }
54
55 public function getValue(): array
56 {
57 return $this->features;
58 }
59}
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804