Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Space.php
1<?php
2
4
8
9final class Space implements Arrayable
10{
11 private int $id;
12 private string $name = '';
13 private bool $isPinned = false;
14 private ?DateTime $dateActivity = null;
15 private string $lastActivityDescription = '';
16 private ?Avatar $avatar = null;
17 private string $visibilityType = '';
18 private int $counter = 0;
19 private ?Datetime $lastSearchDate = null;
20 private string $userRole = '';
21 private bool $follow = false;
22
23 public function getId(): int
24 {
25 return $this->id;
26 }
27
28 public function setId(int $id): self
29 {
30 $this->id = $id;
31
32 return $this;
33 }
34
35 public function getName(): string
36 {
37 return $this->name;
38 }
39
40 public function setName(string $name): self
41 {
42 $this->name = $name;
43
44 return $this;
45 }
46
47 public function setIsPinned(bool $isPinned): self
48 {
49 $this->isPinned = $isPinned;
50
51 return $this;
52 }
53
54 public function setDateActivity(DateTime $dateActivity): self
55 {
56 $this->dateActivity = $dateActivity;
57
58 return $this;
59 }
60
61 public function setLastActivityDescription(string $lastActivityDescription): self
62 {
63 $this->lastActivityDescription = $lastActivityDescription;
64
65 return $this;
66 }
67
68 public function setAvatar(Avatar $avatar): self
69 {
70 $this->avatar = $avatar;
71
72 return $this;
73 }
74
75 public function setVisibilityType(string $visibilityType): self
76 {
77 $this->visibilityType = $visibilityType;
78
79 return $this;
80 }
81
82 public function setCounter(int $counter): self
83 {
84 $this->counter = $counter;
85
86 return $this;
87 }
88
89 public function setLastSearchDate(?DateTime $lastSearchDate): self
90 {
91 $this->lastSearchDate = $lastSearchDate;
92
93 return $this;
94 }
95
96 public function setUserRole(string $userRole): self
97 {
98 $this->userRole = $userRole;
99
100 return $this;
101 }
102
103 public function setFollow(bool $follow): self
104 {
105 $this->follow = $follow;
106
107 return $this;
108 }
109
110 public function toArray(): array
111 {
112 return [
113 'id' => $this->id,
114 'name' => $this->name,
115 'isPinned' => $this->isPinned,
116 'dateActivity' => $this->dateActivity,
117 'dateActivityTimestamp' => $this->dateActivity?->getTimestamp(),
118 'lastActivityDescription' => $this->lastActivityDescription,
119 'avatar' => $this->avatar?->toArray(),
120 'visibilityType' => $this->visibilityType,
121 'counter' => $this->counter,
122 'lastSearchDate' => $this->lastSearchDate,
123 'lastSearchDateTimestamp' => $this->lastSearchDate?->getTimestamp(),
124 'userRole' => $this->userRole,
125 'follow' => $this->follow,
126 ];
127 }
128}
setDateActivity(DateTime $dateActivity)
Definition Space.php:54
setVisibilityType(string $visibilityType)
Definition Space.php:75
setLastActivityDescription(string $lastActivityDescription)
Definition Space.php:61
setLastSearchDate(?DateTime $lastSearchDate)
Definition Space.php:89