-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Room11\Jeeves\Chat\Message; | ||
|
||
class RoomEdit implements Message | ||
{ | ||
private $actionId; | ||
|
||
private $userId; | ||
|
||
private $username; | ||
|
||
private $roomId; | ||
|
||
private $content; | ||
|
||
private $timestamp; | ||
|
||
public function __construct(array $data) | ||
{ | ||
$this->actionId = $data['id']; | ||
$this->userId = $data['user_id']; | ||
$this->username = $data['user_name']; | ||
$this->roomId = $data['room_id']; | ||
$this->content = $data['content']; | ||
$this->timestamp = new \DateTime('@' . $data['time_stamp']); | ||
} | ||
|
||
public function getActionId(): int | ||
{ | ||
return $this->actionId; | ||
} | ||
|
||
public function getUserId(): int | ||
{ | ||
return $this->userId; | ||
} | ||
|
||
public function getUsername(): string | ||
{ | ||
return $this->username; | ||
} | ||
|
||
public function getRoomId(): int | ||
{ | ||
return $this->roomId; | ||
} | ||
|
||
public function getContent(): string | ||
{ | ||
return $this->content; | ||
} | ||
|
||
public function getTimestamp(): \DateTime | ||
{ | ||
return $this->timestamp; | ||
} | ||
} |