2016-09-06 15:26:39 +05:30
|
|
|
<?php
|
|
|
|
namespace api\modules\session\models\protocols;
|
|
|
|
|
|
|
|
abstract class BaseHasJoined implements HasJoinedInterface {
|
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
private readonly string $username;
|
2018-04-18 02:17:25 +05:30
|
|
|
|
2024-12-02 15:40:55 +05:30
|
|
|
private readonly string $serverId;
|
2016-09-06 15:26:39 +05:30
|
|
|
|
|
|
|
public function __construct(string $username, string $serverId) {
|
2017-09-19 22:36:16 +05:30
|
|
|
$this->username = trim($username);
|
|
|
|
$this->serverId = trim($serverId);
|
2016-09-06 15:26:39 +05:30
|
|
|
}
|
|
|
|
|
2017-09-19 22:36:16 +05:30
|
|
|
public function getUsername(): string {
|
2016-09-06 15:26:39 +05:30
|
|
|
return $this->username;
|
|
|
|
}
|
|
|
|
|
2017-09-19 22:36:16 +05:30
|
|
|
public function getServerId(): string {
|
2016-09-06 15:26:39 +05:30
|
|
|
return $this->serverId;
|
|
|
|
}
|
|
|
|
|
2017-09-19 22:36:16 +05:30
|
|
|
public function validate(): bool {
|
2024-12-02 15:40:55 +05:30
|
|
|
return $this->username !== '' && $this->serverId !== '';
|
2016-09-06 15:26:39 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|