/
Author.php
153 lines (134 loc) · 2.58 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
/**
* Created by PhpStorm.
* User: davis
* Date: 7/23/17
* Time: 3:05 AM
*/
namespace DavisPeixoto\BlogCore\Entity;
use DateTime;
use Ramsey\Uuid\UuidInterface;
use stdClass;
/**
* Class Author
* @package DavisPeixoto\Entity
*/
class Author extends stdClass
{
/**
* @var UuidInterface
*/
private $authorId;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $email;
/**
* @var string
*/
private $bio;
/**
* @var DateTime
*/
private $birthdate;
/**
* Author constructor.
* @param UuidInterface $authorId
* @param string $name
* @param string $email
* @param string $bio
* @param DateTime $birthdate
*/
public function __construct(UuidInterface $authorId, $name, $email, $bio, DateTime $birthdate = null)
{
$this->authorId = $authorId;
$this->name = $name;
$this->email = $email;
$this->bio = $bio;
$this->birthdate = $birthdate;
}
/**
* @codeCoverageIgnore
* @return UuidInterface
*/
public function getAuthorId(): UuidInterface
{
return $this->authorId;
}
/**
* @codeCoverageIgnore
* @param UuidInterface $authorId
*/
public function setAuthorId(UuidInterface $authorId)
{
$this->authorId = $authorId;
}
/**
* @codeCoverageIgnore
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @codeCoverageIgnore
* @param string $name
*/
public function setName(string $name)
{
$this->name = $name;
}
/**
* @codeCoverageIgnore
* @return string
*/
public function getEmail(): string
{
return $this->email;
}
/**
* @codeCoverageIgnore
* @param string $email
*/
public function setEmail(string $email)
{
$this->email = $email;
}
/**
* @codeCoverageIgnore
* @return string
*/
public function getBio(): string
{
return $this->bio;
}
/**
* @codeCoverageIgnore
* @param string $bio
*/
public function setBio(string $bio)
{
$this->bio = $bio;
}
/**
* @codeCoverageIgnore
* @return DateTime
*/
public function getBirthdate(): DateTime
{
return $this->birthdate;
}
/**
* @codeCoverageIgnore
* @param DateTime $birthdate
*/
public function setBirthdate(DateTime $birthdate)
{
$this->birthdate = $birthdate;
}
}