K
K
kot-airplane2017-09-24 16:37:16
PHP
kot-airplane, 2017-09-24 16:37:16

What class is responsible for this function?

There is a User class responsible for user actions and a Payment class responsible for financial transactions. And now the user has already replenished his balance, the money is in his account and he presses the Upgrade button to upgrade his account to a paid one. Changes will occur in both the users table and the payments table. it will be recorded when and on what the money that lies on the couple was spent.
Which class should perform this Upgrade action: User or Payment and why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Cat Anton, 2017-09-24
@kot-airplane

You can make a separate UserAccountManager class:
UserAccountManager::upgrade($user);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question