-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathFilter.php
More file actions
45 lines (37 loc) · 1.24 KB
/
Filter.php
File metadata and controls
45 lines (37 loc) · 1.24 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
36
37
38
39
40
41
42
43
44
45
<?php
namespace ProcessMaker\Filters;
use Illuminate\Database\Eloquent\Builder;
class Filter extends BaseFilter
{
public const TYPE_PARTICIPANTS = 'Participants';
public const TYPE_PROCESS = 'Process';
public const TYPE_RELATIONSHIP = 'Relationship';
/**
* Forward Status and Participant subjects to PMQL methods on the models.
*
* For now, we only need Participants and Status because Request and Requester
* are columns on the tables (process_request_id and user_id).
*/
protected function valueAliasMethod()
{
$method = null;
switch ($this->subjectType) {
case self::TYPE_PARTICIPANTS:
$method = 'valueAliasParticipant';
break;
case self::TYPE_PARTICIPANTS_FULLNAME:
$method = 'valueAliasParticipantByFullName';
break;
case self::TYPE_ASSIGNEES_FULLNAME:
$method = 'valueAliasAssigneeByFullName';
break;
case self::TYPE_STATUS:
$method = 'valueAliasStatus';
break;
case self::TYPE_ALTERNATIVE:
$method = 'valueAliasAlternative';
break;
}
return $method;
}
}