1 | <?php |
||
13 | class User |
||
14 | { |
||
15 | const AVATAR_SIZE_SMALL = '24'; |
||
16 | const AVATAR_SIZE_MEDIUM = '40'; |
||
17 | const AVATAR_SIZE_LARGE = '80'; |
||
18 | |||
19 | /** |
||
20 | * @var int |
||
21 | * |
||
22 | * @ORM\Column(name="id", type="integer") |
||
23 | * @ORM\Id |
||
24 | */ |
||
25 | private $id; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | * |
||
30 | * @ORM\Column(name="login", type="string", length=255, nullable=false) |
||
31 | */ |
||
32 | private $login; |
||
33 | |||
34 | /** |
||
35 | * @var string|null |
||
36 | * |
||
37 | * @ORM\Column(name="name", type="string", length=255, nullable=true) |
||
38 | */ |
||
39 | private $name; |
||
40 | |||
41 | /** |
||
42 | * @var \DateTime |
||
43 | * |
||
44 | * @ORM\Column(name="created_at", type="datetime") |
||
45 | */ |
||
46 | private $createdAt; |
||
47 | |||
48 | /** |
||
49 | * @var \DateTime |
||
50 | * |
||
51 | * @ORM\Column(name="updated_at", type="datetime", nullable=true) |
||
52 | */ |
||
53 | private $updatedAt; |
||
54 | |||
55 | /** |
||
56 | * @var ArrayCollection|Subscription[] |
||
57 | * |
||
58 | * @ORM\OneToMany(targetEntity="Subscription", mappedBy="author", fetch="EXTRA_LAZY") |
||
59 | */ |
||
60 | private $subscribers; |
||
61 | |||
62 | /** |
||
63 | * @var ArrayCollection|Subscription[] |
||
64 | * |
||
65 | * @ORM\OneToMany(targetEntity="Subscription", mappedBy="subscriber", fetch="EXTRA_LAZY") |
||
66 | */ |
||
67 | private $subscriptions; |
||
68 | |||
69 | /** |
||
70 | * @var ArrayCollection|SubscriptionEvent[] |
||
71 | * @ORM\OneToMany(targetEntity="SubscriptionEvent", mappedBy="author", fetch="EXTRA_LAZY") |
||
72 | */ |
||
73 | private $newSubscriberEvents; |
||
74 | |||
75 | |||
76 | public function __construct(int $id, string $login = null, string $name = null) |
||
87 | |||
88 | /** |
||
89 | * @ORM\PreUpdate |
||
90 | */ |
||
91 | public function preUpdate(): void |
||
95 | |||
96 | public function getId(): int |
||
100 | |||
101 | public function setLogin(string $login): self |
||
107 | |||
108 | 3 | public function getLogin(): string |
|
112 | |||
113 | public function setName(?string $name): self |
||
119 | |||
120 | public function getName(): ?string |
||
124 | 7 | ||
125 | public function addSubscriber(Subscription $subscribers): self |
||
131 | |||
132 | public function removeSubscriber(Subscription $subscribers) |
||
136 | 1 | ||
137 | /** |
||
138 | * @return Subscription[]|ArrayCollection |
||
139 | */ |
||
140 | public function getSubscribers() |
||
144 | |||
145 | /** |
||
146 | * @return Subscription[]|ArrayCollection |
||
147 | */ |
||
148 | public function getSubscriptions() |
||
152 | |||
153 | public function addNewSubscriberEvent(SubscriptionEvent $newSubscriberEvents): self |
||
159 | |||
160 | /** |
||
161 | * @return SubscriptionEvent[]|ArrayCollection |
||
162 | */ |
||
163 | public function getNewSubscriberEvents() |
||
167 | |||
168 | public function getCreatedAt(): \DateTime |
||
172 | |||
173 | public function setCreatedAt(\DateTime $createdAt): self |
||
179 | |||
180 | public function getUpdatedAt(): ?\DateTime |
||
184 | } |
||
185 |