forked from ProcessMaker/processmaker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcess.php
More file actions
28 lines (26 loc) · 789 Bytes
/
Process.php
File metadata and controls
28 lines (26 loc) · 789 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
<?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', ''));
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);
}
return $array;
}
}