1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace plunner\Policies; |
4
|
|
|
|
5
|
|
|
use plunner\MeetingTimeslot; |
6
|
|
|
use plunner\PolicyCheckable; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class MeetingTimeslotPolicy |
10
|
|
|
* @package plunner\Policies |
11
|
|
|
* @author Claudio Cardinale <[email protected]> |
12
|
|
|
* @copyright 2015 Claudio Cardinale |
13
|
|
|
* @version 1.0.0 |
14
|
|
|
*/ |
15
|
|
|
class MeetingTimeslotPolicy |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Create a new policy instance. |
19
|
|
|
* |
20
|
|
|
*/ |
21
|
15 |
|
public function __construct() |
22
|
|
|
{ |
23
|
|
|
// |
24
|
15 |
|
} |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @param PolicyCheckable $policyCheckable |
28
|
|
|
* @param MeetingTimeslot $MeetingTimeslot |
29
|
|
|
* @return bool |
30
|
|
|
*/ |
31
|
|
|
public function index(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot) |
32
|
|
|
{ |
33
|
|
|
return $this->userCheck($policyCheckable, $MeetingTimeslot); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @param PolicyCheckable $policyCheckable |
38
|
|
|
* @param MeetingTimeslot $MeetingTimeslot |
39
|
|
|
* @return bool |
40
|
|
|
*/ |
41
|
15 |
|
private function userCheck(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot) |
42
|
|
|
{ |
43
|
15 |
|
return $policyCheckable->verifyMeetingTimeslot($MeetingTimeslot); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @param PolicyCheckable $policyCheckable |
48
|
|
|
* @param MeetingTimeslot $MeetingTimeslot |
49
|
|
|
* @return bool |
50
|
|
|
*/ |
51
|
|
|
public function store(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot) |
52
|
|
|
{ |
53
|
|
|
return $this->userCheck($policyCheckable, $MeetingTimeslot); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param PolicyCheckable $policyCheckable |
58
|
|
|
* @param MeetingTimeslot $MeetingTimeslot |
59
|
|
|
* @return bool |
60
|
|
|
*/ |
61
|
6 |
|
public function update(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot) |
62
|
|
|
{ |
63
|
6 |
|
return $this->userCheck($policyCheckable, $MeetingTimeslot); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @param PolicyCheckable $policyCheckable |
68
|
|
|
* @param MeetingTimeslot $MeetingTimeslot |
69
|
|
|
* @return bool |
70
|
|
|
*/ |
71
|
9 |
|
public function show(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot) |
72
|
|
|
{ |
73
|
9 |
|
$ret = $this->userCheck($policyCheckable, $MeetingTimeslot); |
74
|
9 |
|
return $ret; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @param PolicyCheckable $policyCheckable |
79
|
|
|
* @param MeetingTimeslot $MeetingTimeslot |
80
|
|
|
* @return bool |
81
|
|
|
*/ |
82
|
6 |
|
public function destroy(PolicyCheckable $policyCheckable, MeetingTimeslot $MeetingTimeslot) |
83
|
|
|
{ |
84
|
6 |
|
return $this->userCheck($policyCheckable, $MeetingTimeslot); |
85
|
|
|
} |
86
|
|
|
} |
87
|
|
|
|