Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 20 |
| AccompanyingEventQuery | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6.00 | |
0.00% |
0 / 20 |
| active | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 17 |
|||
| availableForEvent | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| <?php | |
| namespace common\models; | |
| use Yii; | |
| /** | |
| * This is the query model class for table "{{%accompanying_event}}". | |
| */ | |
| class AccompanyingEventQuery extends \yii\db\ActiveQuery | |
| { | |
| public function active() | |
| { | |
| $this->andWhere( | |
| ['AND', | |
| ['OR', | |
| 'registration_from <= :time', | |
| 'registration_from IS NULL', | |
| ], | |
| ['OR', | |
| 'registration_to >= :time', | |
| 'registration_to IS NULL', | |
| ], | |
| ], [ | |
| ':time' => date('Y-m-d H:i:s'), | |
| ] | |
| ); | |
| return $this; | |
| } | |
| /** | |
| * Select only available accompanying events for event | |
| */ | |
| public function availableForEvent($event_id) | |
| { | |
| return $this->andWhere(['parent_event_id'=> $event_id]); | |
| } | |
| } |