forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkNotificationAsRead.php
More file actions
42 lines (35 loc) · 877 Bytes
/
MarkNotificationAsRead.php
File metadata and controls
42 lines (35 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace ProcessMaker\Jobs;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use ProcessMaker\Models\Notification;
class MarkNotificationAsRead implements ShouldQueue
{
use Dispatchable,
InteractsWithQueue,
Queueable;
public $conditions;
public $updates;
/**
* Create a new job instance.
*
* @param array $conditions
* @param array $updates
*
* @return void
*/
public function __construct($conditions, $updates)
{
$this->conditions = $conditions;
$this->updates = $updates;
}
public function handle()
{
Notification::where($this->conditions)
->whereNull('read_at')
->update($this->updates);
}
}