Commit Graph

13 Commits

Author SHA1 Message Date
Rodrigo Primo
c701f02d27 Pass a copy of the Carbon object to avoid unexpected side effects
This commit changes LastSubscribedAtListener to pass a copy of the Carbon
object representing the current time to the SubscriberEntity property
lastSubscribedAt. Passing a copy instead of the object itself is needed to
avoid unexpected side effects. Before this change, modifying the time
of this property of a given SubscriberEntity instance could affect the
same field of another instance as the same object used inside
LastSubscribedAtListener for all entities.

[MAILPOET-3946]
2021-11-22 10:52:58 +01:00
Rodrigo Primo
2e050d7a32 Pass a copy of the Carbon object to avoid unexpected side effects
This commit changes TimestampListener to pass a copy of the Carbon
object representing the current time to the entity properties updatedAt
and createdAt. Passing a copy instead of the object itself is needed to
avoid unexpected side effects. Before this change, modifying the time
of the createdAt or updatedAt field of a given entity could affect the
same field of another entity as it could be the same object used inside
TimestampListener for all entities.

[MAILPOET-3870]
2021-11-22 09:58:49 +01:00
Jan Lysý
5045dd6aa7 Skip setting created at when is not empty in TimestampListener
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Jan Lysý
fd5a9904c0 Add listener for updating lastSubscribedAt
[MAILPOET-3031]
2021-03-29 15:22:53 +02:00
Rostislav Wolny
96f2bfaa20 Add entity lifecycle listener for emoji sanitisation
[MAILPOET-3196]
2020-10-06 17:36:44 +02:00
Jan Jakeš
54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00
Amine Ben hammou
43df66d162 Add public keyword to methods
[MAILPOET-2413]
2019-12-26 18:09:45 +03:00
Jan Jakeš
0e964de6d4 Move nesbot/carbon to vendor-prefixed
[MAILPOET-2560]
2019-12-15 21:55:48 +00:00
Jan Jakeš
59480cdfb2 Move ValidationException under Validator namespace
[MAILPOET-2437]
2019-10-24 11:03:09 +01:00
Jan Jakeš
2bdf8643fc Use factory to create Validator, reuse AnnotationReaderProvider
[MAILPOET-2437]
2019-10-24 11:03:09 +01:00
Jan Jakeš
730f640cc3 Integrate symfony/validator with Doctrine entitites
[MAILPOET-2437]
2019-10-24 11:03:09 +01:00
Jan Jakeš
11b166d018 Use WP timestamp in TimestampListener
[MAILPOET-2014]
2019-07-24 15:03:16 -04:00
Jan Jakeš
4cbc89368c Add entity traits for created_at and updated_at fields
[MAILPOET-2014]
2019-07-24 15:03:16 -04:00