Guest User

Untitled

a guest
Jan 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public static function SendNoticeToMentionedUsers($usernames,ModelUser $mentionedBy) {
  2. foreach ($usernames as $username)
  3. {
  4. $u = new ModelUser();
  5. $u->LoadByUsername($username);
  6.  
  7. if(!$u->Loaded())
  8. continue;
  9.  
  10. $notice = new ModelNotification();
  11. $notice->Create();
  12.  
  13. $notice->SetMsg("{$mentionedBy->GetUsername} has mentioned you");
  14. $notice->SetUser($u->GetId());
  15.  
  16. FactoryPush::NotificationToUser($notice);
  17.  
  18. unset($u, $notice);
  19. }
  20. }
Add Comment
Please, Sign In to add comment