| Total Complexity | 6 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class MultiTenantQuery extends ActiveQuery |
||
| 10 | { |
||
| 11 | private $_withTenant = true; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * {@inheritDoc} |
||
| 15 | */ |
||
| 16 | 3 | public function prepare($builder) |
|
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Disables where tenant condition |
||
| 26 | * @return $this |
||
| 27 | */ |
||
| 28 | 3 | public function withoutTenant() |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Enables where tenant condition |
||
| 36 | * @return $this |
||
| 37 | */ |
||
| 38 | public function withTenant() |
||
| 39 | { |
||
| 40 | $this->_withTenant = true; |
||
| 41 | return $this; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Adds an additional WHERE tenant condition to the existing one. |
||
| 46 | * @return void |
||
| 47 | */ |
||
| 48 | 3 | private function addTenantCondition() |
|
| 56 | } |
||
| 57 | } |
||
| 58 | } |