Users and presenters have a many-many relationship. Relationship between presentations and users is saved in a separate table (presentations_presenters_users)
-
can you please explain why they are stored in a seprate table ?
i think you are creating collections based on an ERD diagram, whereas you don’t need to create it in that way. -
- afterUpdate lifecycle method only has data pertaining to the updated record (ie information regarding the user/presenter that was removed is not available). As a result, I cannot update the count for the effected user.
There are 2 parameters in the afterUpdate hook, one is the data, and the other is the result.
result will have the latest updated record, whereas data will have the record which was sent to update via frontend
- afterUpdate lifecycle method only has data pertaining to the updated record (ie information regarding the user/presenter that was removed is not available). As a result, I cannot update the count for the effected user.
-
beforeUpdate lifecycle method does not provide any details as to what update/modification will be made to the record. Hence, I am unable to update count
beforeUpdate will have only one parameter, which is the data sent from the frontEnd, since the record is updated yet, so there will be no result in it