1 | <?php |
||
23 | class UserMessagesSettings extends FormAbstract |
||
24 | { |
||
25 | /** |
||
26 | * @var Collection |
||
27 | */ |
||
28 | protected $projects; |
||
29 | |||
30 | /** |
||
31 | * @var Collection |
||
32 | */ |
||
33 | protected $messages; |
||
34 | |||
35 | /** |
||
36 | * @var Message |
||
37 | */ |
||
38 | protected $defaultMessage; |
||
39 | |||
40 | /** |
||
41 | * @param Collection $projects |
||
42 | * |
||
43 | * @return $this |
||
44 | */ |
||
45 | public function setProjects(Collection $projects) |
||
51 | |||
52 | /** |
||
53 | * @return array |
||
54 | */ |
||
55 | public function actions() |
||
61 | |||
62 | /** |
||
63 | * @return array |
||
64 | */ |
||
65 | public function fields() |
||
90 | |||
91 | /** |
||
92 | * Returns collection of all messages options. |
||
93 | * |
||
94 | * @return Collection |
||
95 | */ |
||
96 | protected function getMessages() |
||
104 | |||
105 | /** |
||
106 | * Return default message for the current logged user based on the role. |
||
107 | * |
||
108 | * @return Message |
||
109 | */ |
||
110 | protected function getDefaultMessage() |
||
119 | |||
120 | /** |
||
121 | * Return value of selected message for a project. |
||
122 | * |
||
123 | * @param ProjectModel $project |
||
124 | * |
||
125 | * @return int |
||
126 | */ |
||
127 | protected function getSelectedMessage(ProjectModel $project) |
||
140 | } |
||
141 |