N
N
nepster-web2014-08-26 13:35:21
PHP
nepster-web, 2014-08-26 13:35:21

How to correctly implement the structure of the Notifications module?

So, for example, there are several modules in the system that should notify the user of any actions.
For example:
- A new partner in the structure
- Transfer of Funds
- Achieving a new Rank
, etc.
The problem is that there is no way to make the modules not be closely related to the notifications module (so that each module does not directly access the notifications).
Therefore, the idea came up to make sure that each module that should send notifications had its own table in the database for these purposes.
After that, the notification module receives dependent modules using Dependency Injection and knows where to get and show notifications from.
But here it turns out the moment when one approximately identical table appears in the database for almost each module. How critical is this? Are there any ideas how to implement such a thing at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zelenin, 2014-08-26
@zelenin

you are already creating the third topic on the same question, here and on the yii forum.
In each module, when you do something, an event is called. In another module, you subscribe to this event and write everything to the table of this module.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question