MVC - , . Factory - . , Google Factory . : FooFactory - , Foo ( FooModel, ).
MVC Factory , UserFactoryClass.
User::getUserFromCampaign(1)for me, a little strange. I suppose 1is a campaign identifier? Then which user returns this? Or can a campaign have only one user? If so, it UserFactory::getUserFromCampaign()will return a UserModel object for the user in the campaign with the given identifier.
User::getUsersNotInCampaign()I assume returns an array of UserModel objects? Refactor it in `UserFactory::getUsersNotInCampaign()and there you go.
User::isAdmin()should not be static at all.
if ($user->isAdmin()) ..., notif(User::isAdmin($user))...
source
share