/
Author.php
90 lines (79 loc) · 1.5 KB
/
Author.php
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
namespace Concrete\Core\Conversation\Message;
use Concrete\Core\User\UserInfo;
class Author
{
protected $user;
protected $name;
protected $email;
protected $website;
/**
* @return \Concrete\Core\User\UserInfo
*/
public function getUser()
{
return $this->user;
}
/**
* @param mixed
*/
public function setUser($user)
{
if ($user instanceof \Concrete\Core\User\User) {
$this->user = UserInfo::getByID($user->getUserID());
} else {
$this->user = $user;
}
$this->name = $this->user->getUserName();
$this->email = $this->user->getUserEmail();
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getWebsite()
{
return $this->website;
}
/**
* @param mixed $website
*/
public function setWebsite($website)
{
$this->website = $website;
}
/**
* @return mixed
*/
public function getEmail()
{
return $this->email;
}
/**
* @param mixed $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
*
*/
public function getFormatter()
{
return \Core::make(AuthorFormatter::class, [$this]);
}
}