1 | <?php |
||
7 | abstract class BaseTenant extends Model |
||
8 | { |
||
9 | /** |
||
10 | * Construct the model with the provided config settings |
||
11 | * or use our fallbacks if none are provided |
||
12 | */ |
||
13 | public function __construct(array $attributes = []) |
||
22 | |||
23 | /** |
||
24 | * Merge the fillable fields with any provided in the extending class |
||
25 | */ |
||
26 | public function setFillable() |
||
40 | |||
41 | /** |
||
42 | * Merge the fillable fields with any provided in the extending class |
||
43 | */ |
||
44 | public function owner() |
||
48 | |||
49 | /** |
||
50 | * The features relationship |
||
51 | */ |
||
52 | public function features() |
||
61 | |||
62 | /** |
||
63 | * The users relationship |
||
64 | */ |
||
65 | public function users() |
||
74 | |||
75 | /** |
||
76 | * Assign the given user to the teannt |
||
77 | * |
||
78 | * @param BaseUser $user |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | public function assignUser(BaseUser $user) |
||
86 | |||
87 | /** |
||
88 | * Test that user has access to the this tenant |
||
89 | * |
||
90 | * @param BaseUser $user |
||
91 | * |
||
92 | * @return boolean |
||
93 | */ |
||
94 | public function hasUser(BaseUser $user) |
||
98 | |||
99 | /** |
||
100 | * Assign the given feature to the teannt |
||
101 | * |
||
102 | * @param BaseFeature $feature |
||
103 | * |
||
104 | * @return void |
||
105 | */ |
||
106 | public function assignFeature(BaseFeature $feature) |
||
110 | |||
111 | /** |
||
112 | * Test that the tenant has access to a given feature |
||
113 | * |
||
114 | * @param BaseFeature $feature |
||
115 | * |
||
116 | * @return boolean |
||
117 | */ |
||
118 | public function hasFeature(BaseFeature $feature) |
||
122 | } |
||
123 |