1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Space.php
См. документацию.
1<?php
2
3namespace Bitrix\Socialnetwork\Space\List\Item;
4
5use Bitrix\Main\Type\Contract\Arrayable;
6use Bitrix\Main\Type\DateTime;
7use Bitrix\Socialnetwork\Helper\Avatar;
8use Bitrix\Socialnetwork\Space\List\RecentActivity\Item\RecentActivityData;
9
10final class Space implements Arrayable
11{
12 private int $id;
13 private string $name = '';
14 private bool $isPinned = false;
15 private ?Avatar $avatar = null;
16 private string $visibilityType = '';
17 private int $counter = 0;
18 private ?Datetime $lastSearchDate = null;
19 private string $userRole = '';
20 private bool $follow = false;
21 private ?RecentActivityData $recentActivityData = null;
22 private array $permissions = [];
23
24 public function getId(): int
25 {
26 return $this->id;
27 }
28
29 public function setId(int $id): self
30 {
31 $this->id = $id;
32
33 return $this;
34 }
35
36 public function getName(): string
37 {
38 return $this->name;
39 }
40
41 public function setName(string $name): self
42 {
43 $this->name = $name;
44
45 return $this;
46 }
47
48 public function setIsPinned(bool $isPinned): self
49 {
50 $this->isPinned = $isPinned;
51
52 return $this;
53 }
54
55 public function setAvatar(Avatar $avatar): self
56 {
57 $this->avatar = $avatar;
58
59 return $this;
60 }
61
62 public function setVisibilityType(string $visibilityType): self
63 {
64 $this->visibilityType = $visibilityType;
65
66 return $this;
67 }
68
69 public function setCounter(int $counter): self
70 {
71 $this->counter = $counter;
72
73 return $this;
74 }
75
76 public function setLastSearchDate(?DateTime $lastSearchDate): self
77 {
78 $this->lastSearchDate = $lastSearchDate;
79
80 return $this;
81 }
82
83 public function setUserRole(string $userRole): self
84 {
85 $this->userRole = $userRole;
86
87 return $this;
88 }
89
90 public function setFollow(bool $follow): self
91 {
92 $this->follow = $follow;
93
94 return $this;
95 }
96
97 public function setRecentActivityData(?RecentActivityData $recentActivityData): self
98 {
99 $this->recentActivityData = $recentActivityData;
100
101 return $this;
102 }
103
105 {
106 return $this->recentActivityData;
107 }
108
109 public function setPermissions(array $permissions): self
110 {
111 $this->permissions = $permissions;
112
113 return $this;
114 }
115
116 public function toArray(): array
117 {
118 return [
119 'id' => $this->id,
120 'name' => $this->name,
121 'isPinned' => $this->isPinned,
122 'avatar' => $this->avatar?->toArray(),
123 'visibilityType' => $this->visibilityType,
124 'counter' => $this->counter,
125 'lastSearchDate' => $this->lastSearchDate,
126 'lastSearchDateTimestamp' => $this->lastSearchDate?->getTimestamp(),
127 'userRole' => $this->userRole,
128 'follow' => $this->follow,
129 'recentActivityData' => $this->recentActivityData?->toArray(),
130 'permissions' => $this->permissions,
131 ];
132 }
133}
setName(string $name)
Определения Space.php:41
setPermissions(array $permissions)
Определения Space.php:109
setFollow(bool $follow)
Определения Space.php:90
setRecentActivityData(?RecentActivityData $recentActivityData)
Определения Space.php:97
setIsPinned(bool $isPinned)
Определения Space.php:48
setAvatar(Avatar $avatar)
Определения Space.php:55
setVisibilityType(string $visibilityType)
Определения Space.php:62
setUserRole(string $userRole)
Определения Space.php:83
setCounter(int $counter)
Определения Space.php:69
setLastSearchDate(?DateTime $lastSearchDate)
Определения Space.php:76
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
$counter
Определения options.php:5