Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static function SendNoticeToMentionedUsers($usernames,ModelUser $mentionedBy) {
- foreach ($usernames as $username)
- {
- $u = new ModelUser();
- $u->LoadByUsername($username);
- if(!$u->Loaded())
- continue;
- $notice = new ModelNotification();
- $notice->Create();
- $notice->SetMsg("{$mentionedBy->GetUsername} has mentioned you");
- $notice->SetUser($u->GetId());
- FactoryPush::NotificationToUser($notice);
- unset($u, $notice);
- }
- }
Add Comment
Please, Sign In to add comment