Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 14 |
| TableQuery | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
20.00 | |
0.00% |
0 / 14 |
| isSpecial | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| isAssigned | |
0.00% |
0 / 1 |
6.00 | |
0.00% |
0 / 5 |
|||
| isBusyOnSpanAndTime | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 6 |
|||
| <?php | |
| namespace common\models; | |
| /** | |
| * This is the query model class for table "{{%table}}". | |
| */ | |
| class TableQuery extends \yii\db\ActiveQuery | |
| { | |
| public function isSpecial($is_special = true) | |
| { | |
| return $this->andWhere(['=', 'is_special', $is_special]); | |
| } | |
| public function isAssigned($is_assigned = true) | |
| { | |
| return $this | |
| ->leftJoin(['organization_table' => '{{%organization_table}}'], '{{%table}}.id = organization_table.table_id') | |
| ->andWhere([($is_assigned ? 'IS NOT' : 'IS'), 'organization_table.table_id', null]); | |
| } | |
| public function isBusyOnSpanAndTime($event_span_id, $event_span_time_on) | |
| { | |
| return $this | |
| ->rightJoin(['meeting_rj' => Meeting::tableName()], '{{%table}}.id = meeting_rj.table_id') | |
| ->andWhere(['=', 'meeting_rj.event_span_id', $event_span_id]) | |
| ->andWhere(['=', 'meeting_rj.event_span_time_on', $event_span_time_on]); | |
| } | |
| } |