-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathProcess.php
More file actions
35 lines (32 loc) · 1.15 KB
/
Process.php
File metadata and controls
35 lines (32 loc) · 1.15 KB
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
<?php
namespace ProcessMaker\Http\Resources;
class Process extends ApiResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request
* @return array
*/
public function toArray($request)
{
$array = parent::append('notifications', 'task_notifications')->toArray($request);
$include = explode(',', $request->input('include', ''));
$filterWithoutAssignments = $request->input('filter_without_assignments', false);
if (in_array('user', $include)) {
$array['user'] = new Users($this->user);
}
if (in_array('category', $include)) {
$array['category'] = new ProcessCategory($this->category);
}
if (in_array('events', $include)) {
$array['events'] = $this->getStartEvents(true, $filterWithoutAssignments);
}
if (in_array('svg', $include)) {
$array['svg'] = $this->svg;
}
$array['manager_id'] = $this->manager_id;
$array['case_retention_tier_adjustment_notice'] = (bool) ($this->resource->case_retention_tier_adjustment_notice ?? false);
return $array;
}
}