1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* YAWIK |
4
|
|
|
* |
5
|
|
|
* @filesource |
6
|
|
|
* @copyright https://yawik.org/COPYRIGHT.php |
7
|
|
|
* @license MIT |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
namespace Organizations\Entity; |
11
|
|
|
|
12
|
|
|
use Core\Entity\AbstractIdentifiableHydratorAwareEntity; |
13
|
|
|
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* Defines the contact address of an organization |
17
|
|
|
* |
18
|
|
|
* @ODM\EmbeddedDocument |
19
|
|
|
*/ |
20
|
|
|
class WorkflowSettings extends AbstractIdentifiableHydratorAwareEntity implements WorkflowSettingsInterface |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* Accept application by department manager |
24
|
|
|
* |
25
|
|
|
* @var bool |
26
|
|
|
* @ODM\Field(type="bool") */ |
27
|
|
|
protected $acceptApplicationByDepartmentManager = true; |
28
|
|
|
|
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Accept application by department manager |
32
|
|
|
* |
33
|
|
|
* @var bool |
34
|
|
|
* @ODM\Field(type="bool") */ |
35
|
|
|
protected $assignDepartmentManagersToJobs = true; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Accept application by recruiters, forward to department manager |
39
|
|
|
* |
40
|
|
|
* @var bool |
41
|
|
|
* @ODM\Field(type="bool") |
42
|
|
|
*/ |
43
|
|
|
protected $acceptApplicationByRecruiters = false; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Sets AcceptApplicationByDepartmentManager |
47
|
|
|
* |
48
|
|
|
* Will set acceptApplicationByRecruiters to _false_. |
49
|
|
|
* |
50
|
|
|
* @param bool $acceptApplicationByDepartmentManager |
51
|
|
|
* @return WorkflowSettings |
52
|
|
|
*/ |
53
|
|
|
public function setAcceptApplicationByDepartmentManager($acceptApplicationByDepartmentManager) |
54
|
|
|
{ |
55
|
|
|
$this->acceptApplicationByDepartmentManager = $acceptApplicationByDepartmentManager; |
56
|
|
|
$acceptApplicationByDepartmentManager && $this->acceptApplicationByRecruiters = false; |
57
|
|
|
return $this; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Gets AcceptApplicationByDepartmentManager |
62
|
|
|
* |
63
|
|
|
* @return bool |
64
|
|
|
*/ |
65
|
|
|
public function getAcceptApplicationByDepartmentManager() |
66
|
|
|
{ |
67
|
|
|
return $this->acceptApplicationByDepartmentManager; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Sets AssignDepartmentManagersToJobs |
72
|
|
|
* |
73
|
|
|
* @param bool $assignDepartmentManagersToJobs |
74
|
|
|
* @return WorkflowSettings |
75
|
|
|
*/ |
76
|
|
|
public function setAssignDepartmentManagersToJobs($assignDepartmentManagersToJobs) |
77
|
|
|
{ |
78
|
|
|
$this->assignDepartmentManagersToJobs = $assignDepartmentManagersToJobs; |
79
|
|
|
return $this; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* Gets AssignDepartmentManagersToJobs |
84
|
|
|
* |
85
|
|
|
* @return bool |
86
|
|
|
*/ |
87
|
|
|
public function getAssignDepartmentManagersToJobs() |
88
|
|
|
{ |
89
|
|
|
return $this->assignDepartmentManagersToJobs; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
public function setAcceptApplicationByRecruiters(bool $flag): void |
93
|
|
|
{ |
94
|
|
|
$this->acceptApplicationByRecruiters = $flag; |
95
|
|
|
$flag && $this->acceptApplicationByDepartmentManager = false; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
public function getAcceptApplicationByRecruiters(): bool |
99
|
|
|
{ |
100
|
|
|
return $this->acceptApplicationByRecruiters; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
public function hasActiveWorkflow(): bool |
104
|
|
|
{ |
105
|
|
|
return $this->acceptApplicationByDepartmentManager || $this->acceptApplicationByRecruiters; |
106
|
|
|
} |
107
|
|
|
} |
108
|
|
|
|