When you follow any record, followEntity method creates a new record in the Subscription table. AfterSave hook of the subscription entity is triggered since createEntity method is being used.
But when you unfollow the record, unfollowEntity method deletes the record from the Subscription table. None of the subscription hook methods like afterRemove or beforeRemove are triggered because unfollowEntity uses ORM delete query builder to delete the record instead of the removeEntity method.
Is there any way to trigger hooks while using the ORM delete query builder?
Like:
1. beforeDelete or afterDelete methods in the hooks (these methods don't exist in the latest version, not sure if they did before)
2. afterDeleteEntity in custom subscription controller or services.
But when you unfollow the record, unfollowEntity method deletes the record from the Subscription table. None of the subscription hook methods like afterRemove or beforeRemove are triggered because unfollowEntity uses ORM delete query builder to delete the record instead of the removeEntity method.
Is there any way to trigger hooks while using the ORM delete query builder?
Like:
1. beforeDelete or afterDelete methods in the hooks (these methods don't exist in the latest version, not sure if they did before)
2. afterDeleteEntity in custom subscription controller or services.
Comment