Guest User

Untitled

a guest
Nov 21st, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. Array
  2. ( [0] => commonmodelsNotificationUpdates Object
  3. (
  4. [_attributes:yiidbBaseActiveRecord:private] => Array
  5. (
  6. [id] => 1
  7. [title] => This is the notification to inform you about this.
  8. [status] => 1
  9. [created_at] => 2017-11-20 08:29:21
  10. )
  11. )
  12. [1] => commonmodelsNotificationUpdates Object
  13. (
  14. [_attributes:yiidbBaseActiveRecord:private] => Array
  15. (
  16. [id] => 2
  17. [title] => This is the notification to inform you about this cricket match
  18. [status] => 1
  19. [created_at] => 2017-11-20 06:24:09
  20. )
  21. )
  22. [2] => commonmodelsNotificationUpdates Object
  23. (
  24. [_attributes:yiidbBaseActiveRecord:private] => Array
  25. (
  26. [id] => 3
  27. [title] => Inform you about this cricket match
  28. [status] => 1
  29. [created_at] => 2017-11-21 11:40:31
  30. )
  31. )
  32.  
  33. )
  34.  
  35. Array
  36. (
  37. [0] => commonmodelsDeletedNofitication Object
  38. (
  39. [_attributes:yiidbBaseActiveRecord:private] => Array
  40. (
  41. [notification_id] => 1
  42. )
  43. )
  44.  
  45. [1] => commonmodelsDeletedNofitication Object
  46. (
  47. [_attributes:yiidbBaseActiveRecord:private] => Array
  48. (
  49. [notification_id] => 2
  50. )
  51. )
  52.  
  53. )
  54.  
  55. $notifications = NotificationUpdates::find()->where([])->all();
  56. $outt = [];
  57.  
  58. foreach($notifications as $notification) {
  59. $deleted_notification = DeletedNofitication::find()->select('notification_id')->where(['user_id'=>$user_id])->all();
  60.  
  61. $outt[] = ['id' => $notification->id,
  62. 'notification_title' =>$notification->title,
  63. ];
  64. }
  65.  
  66. $out = ['notification'=>$outt,'success' => true, 'message' => 'All Notification Updates'];
Add Comment
Please, Sign In to add comment