Myself.php
674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Created by PhpStorm.
* User: Hanson
* Date: 2017/1/3
* Time: 21:54
*/
namespace Hanson\Vbot\Core;
class Myself
{
static $instance;
public $nickname;
public $username;
public $uin;
public $sex;
public static function getInstance()
{
if (!static::$instance) {
static::$instance = new Myself();
}
return static::$instance;
}
public function init($user)
{
contact()->put($user['UserName'], $user);
$this->nickname = $user['NickName'];
$this->username = $user['UserName'];
$this->sex = $user['Sex'];
$this->uin = $user['Uin'];
}
}