Esempio n. 1
0
 public function __construct(array $data, ChatRoom $room)
 {
     parent::__construct($data, $room->getIdentifier()->getHost());
     $this->room = $room;
     $this->userId = $data['user_id'];
     $this->userName = $data['user_name'];
 }
Esempio n. 2
0
 public function __construct(array $data, ChatRoom $room)
 {
     parent::__construct($data, $room->getIdentifier()->getHost());
     $this->userId = (int) $data['user_id'];
     $this->userName = (string) $data['user_name'];
     $this->roomId = (int) $data['room_id'];
     $this->roomName = (string) $data['room_name'];
 }
Esempio n. 3
0
 public function __construct(array $data, ChatRoom $room)
 {
     parent::__construct($data, $room->getIdentifier()->getHost());
     $this->room = $room;
     $this->messageId = $data['message_id'];
     $this->content = $data['content'];
     $this->numberOfStars = $data['message_stars'] ?? 0;
     $this->pinned = isset($data['message_owner_stars']);
 }
Esempio n. 4
0
 public function __construct(array $data, ChatRoom $room)
 {
     parent::__construct($data, $room->getIdentifier()->getHost());
     $this->room = $room;
     $this->userId = (int) $data['user_id'];
     $this->userName = (string) $data['user_name'];
     $this->messageId = (int) $data['message_id'];
     $this->messageContent = domdocument_load_html((string) ($data['content'] ?? ''), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
     $this->parentId = (int) ($data['parent_id'] ?? -1);
     $this->showParent = (bool) ($data['show_parent'] ?? false);
 }
Esempio n. 5
0
 public function testGetTimestamp()
 {
     $timestamp = $this->event->getTimestamp();
     $this->assertInstanceOf(\DateTimeImmutable::class, $timestamp);
     $this->assertSame('1970-01-01 00:16:45', $timestamp->format('Y-m-d H:i:s'));
 }
Esempio n. 6
0
 public function __construct(array $data, ChatRoom $room)
 {
     parent::__construct($data, $room->getIdentifier()->getHost());
 }