/packages/Chat/Chat/Objects/ChatUser.class.php
PHP | 17 lines | 15 code | 2 blank | 0 comment | 1 complexity | 3f89c10fb2f6f06c46e3e356045f63a3 MD5 | raw file
- <?php
- class ChatUser
- {
- public $userId;
-
- public function __construct($userId){
- if(empty($userId) or !is_numeric($userId)){
- throw new InvalidArgumentException("\$userId has to be non zero integer");
- }
- $this->userId = $userId;
- }
-
- public static function getObject($userId){
- $chatUserClassName = ConfigManager::getConfig("Chat", "Chat")->AuxConfig->chatUserClassName;
- return new $chatUserClassName($userId);
- }
- }