| Total Complexity | 9 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 92.86% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | trait MultiTenantRecord |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | *@inheritdoc |
||
| 12 | */ |
||
| 13 | 1 | public function beforeSave($insert) |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * {@inheritdoc} |
||
| 31 | */ |
||
| 32 | 2 | public static function find() |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * This method is invoked before assign the attribute tenant id |
||
| 39 | * You may override this method to do preliminary checks before apply tenant id. |
||
| 40 | * @return boolean whether the tenant id should be assigned. Defaults to true. |
||
| 41 | */ |
||
| 42 | 1 | protected function beforeApplyTenant() |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * This method is invoked after assign the attribute tenant id |
||
| 49 | * You may override this method to do postprocessing after apply tenant id. |
||
| 50 | */ |
||
| 51 | 1 | protected function afterApplyTenant() |
|
| 56 |