1919 * campaigns for those subscriber lists.
2020 * @author Oliver Klee <[email protected] > 2121 * @author Tatevik Grigoryan <[email protected] > 22+ * @SuppressWarnings(TooManyFields)
2223 */
2324#[ORM \Entity(repositoryClass: SubscriberRepository::class)]
2425#[ORM \Table(name: 'phplist_user_user ' )]
2526#[ORM \Index(name: 'idxuniqid ' , columns: ['uniqid ' ])]
2627#[ORM \Index(name: 'enteredindex ' , columns: ['entered ' ])]
2728#[ORM \Index(name: 'confidx ' , columns: ['confirmed ' ])]
2829#[ORM \Index(name: 'blidx ' , columns: ['blacklisted ' ])]
30+ #[ORM \Index(name: 'optidx ' , columns: ['optedin ' ])]
31+ #[ORM \Index(name: 'uuididx ' , columns: ['uuid ' ])]
32+ #[ORM \Index(name: 'foreignkey ' , columns: ['foreignkey ' ])]
33+ #[ORM \UniqueConstraint(name: 'email ' , columns: ['email ' ])]
2934#[ORM \HasLifecycleCallbacks]
3035class Subscriber implements DomainModel, Identity, CreationDate, ModificationDate
3136{
@@ -37,8 +42,8 @@ class Subscriber implements DomainModel, Identity, CreationDate, ModificationDat
3742 #[ORM \Column(name: 'entered ' , type: 'datetime ' , nullable: true )]
3843 protected ?DateTime $ createdAt = null ;
3944
40- #[ORM \Column(name: 'modified ' , type: 'datetime ' )]
41- private ? DateTime $ updatedAt = null ;
45+ #[ORM \Column(name: 'modified ' , type: 'datetime ' , nullable: false )]
46+ private DateTime $ updatedAt ;
4247
4348 #[ORM \Column(unique: true )]
4449 private string $ email = '' ;
@@ -52,7 +57,7 @@ class Subscriber implements DomainModel, Identity, CreationDate, ModificationDat
5257 #[ORM \Column(name: 'bouncecount ' , type: 'integer ' )]
5358 private int $ bounceCount = 0 ;
5459
55- #[ORM \Column(name: 'uniqid ' , unique : true )]
60+ #[ORM \Column(name: 'uniqid ' , type: ' string ' , length: 255 , nullable : true )]
5661 private string $ uniqueId = '' ;
5762
5863 #[ORM \Column(name: 'htmlemail ' , type: 'boolean ' )]
@@ -61,8 +66,8 @@ class Subscriber implements DomainModel, Identity, CreationDate, ModificationDat
6166 #[ORM \Column(type: 'boolean ' )]
6267 private bool $ disabled = false ;
6368
64- #[ORM \Column(name: 'extradata ' , type: 'text ' )]
65- private ?string $ extraData ;
69+ #[ORM \Column(name: 'extradata ' , type: 'text ' , nullable: true )]
70+ private ?string $ extraData = null ;
6671
6772 #[ORM \OneToMany(
6873 targetEntity: Subscription::class,
@@ -83,12 +88,34 @@ class Subscriber implements DomainModel, Identity, CreationDate, ModificationDat
8388 )]
8489 private Collection $ attributes ;
8590
91+ #[ORM \Column(name: 'optedin ' , type: 'boolean ' )]
92+ private bool $ optedIn = false ;
93+
94+ #[ORM \Column(name: 'uuid ' , type: 'string ' , length: 36 )]
95+ private string $ uuid = '' ;
96+
97+ #[ORM \Column(name: 'subscribepage ' , type: 'integer ' , nullable: true )]
98+ private ?int $ subscribePage = null ;
99+
100+ #[ORM \Column(name: 'rssfrequency ' , type: 'string ' , length: 100 , nullable: true )]
101+ private ?string $ rssFrequency = null ;
102+
103+ #[ORM \Column(name: 'password ' , type: 'string ' , length: 255 , nullable: true )]
104+ private ?string $ password = null ;
105+
106+ #[ORM \Column(name: 'passwordchanged ' , type: 'datetime ' , nullable: true )]
107+ private ?DateTime $ passwordChanged = null ;
108+
109+ #[ORM \Column(name: 'foreignkey ' , type: 'string ' , length: 100 , nullable: true )]
110+ private ?string $ foreignKey = null ;
111+
86112 public function __construct ()
87113 {
88114 $ this ->subscriptions = new ArrayCollection ();
89115 $ this ->attributes = new ArrayCollection ();
90116 $ this ->extraData = '' ;
91117 $ this ->createdAt = new DateTime ();
118+ $ this ->updatedAt = new DateTime ();
92119 }
93120
94121 public function getId (): ?int
@@ -101,12 +128,11 @@ public function getCreatedAt(): ?DateTime
101128 return $ this ->createdAt ;
102129 }
103130
104- public function getUpdatedAt (): ? DateTime
131+ public function getUpdatedAt (): DateTime
105132 {
106133 return $ this ->updatedAt ;
107134 }
108135
109- #[ORM \PrePersist]
110136 #[ORM \PreUpdate]
111137 public function updateUpdatedAt (): void
112138 {
@@ -279,4 +305,74 @@ public function removeAttribute(SubscriberAttributeValue $attribute): self
279305 $ this ->attributes ->removeElement ($ attribute );
280306 return $ this ;
281307 }
308+
309+ public function isOptedIn (): bool
310+ {
311+ return $ this ->optedIn ;
312+ }
313+
314+ public function setOptedIn (bool $ optedIn ): void
315+ {
316+ $ this ->optedIn = $ optedIn ;
317+ }
318+
319+ public function getUuid (): string
320+ {
321+ return $ this ->uuid ;
322+ }
323+
324+ public function setUuid (string $ uuid ): void
325+ {
326+ $ this ->uuid = $ uuid ;
327+ }
328+
329+ public function getSubscribePage (): ?int
330+ {
331+ return $ this ->subscribePage ;
332+ }
333+
334+ public function setSubscribePage (?int $ subscribePage ): void
335+ {
336+ $ this ->subscribePage = $ subscribePage ;
337+ }
338+
339+ public function getRssFrequency (): ?string
340+ {
341+ return $ this ->rssFrequency ;
342+ }
343+
344+ public function setRssFrequency (?string $ rssFrequency ): void
345+ {
346+ $ this ->rssFrequency = $ rssFrequency ;
347+ }
348+
349+ public function getPassword (): ?string
350+ {
351+ return $ this ->password ;
352+ }
353+
354+ public function setPassword (?string $ password ): void
355+ {
356+ $ this ->password = $ password ;
357+ }
358+
359+ public function getPasswordChanged (): ?DateTime
360+ {
361+ return $ this ->passwordChanged ;
362+ }
363+
364+ public function setPasswordChanged (?DateTime $ passwordChanged ): void
365+ {
366+ $ this ->passwordChanged = $ passwordChanged ;
367+ }
368+
369+ public function getForeignKey (): ?string
370+ {
371+ return $ this ->foreignKey ;
372+ }
373+
374+ public function setForeignKey (?string $ foreignKey ): void
375+ {
376+ $ this ->foreignKey = $ foreignKey ;
377+ }
282378}
0 commit comments