status; } /** * Information about the user * * @return User */ public function getUser(): User { return $this->user; } /** * Returns an array representation of the object * * @return array */ public function toArray(): array { return [ 'status' => $this->getStatus(), 'user' => ($this->user instanceof ObjectTypeInterface) ? $this->user->toArray() : $this->user, ]; } /** * Constructs object from an array representation * * @param array $data * @return ChatMemberMember */ public static function fromArray(array $data): self { $object = new self(); $object->status = $data['status'] ?? ChatMemberStatus::MEMBER; $object->user = isset($data['user']) ? User::fromArray($data['user']) : null; return $object; } /** * Constructs object from ChatMember object * * @param ChatMember $chatMember * @return static */ public static function fromChatMember(ChatMember $chatMember): self { $object = new self(); $object->status = $chatMember->getStatus(); $object->user = $chatMember->getUser(); return $object; } }