Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 15 |
| EventSpanResource | |
0.00% |
0 / 1 |
|
0.00% |
0 / 4 |
20.00 | |
0.00% |
0 / 15 |
| getLinks | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 6 |
|||
| getParticipants | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getEvent | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getMeetings | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| <?php | |
| namespace api\modules\v1\models; | |
| use common\models\EventSpan; | |
| use yii\base\Model; | |
| use yii\web\Link; // represents a link object as defined in JSON Hypermedia API Language. | |
| use yii\web\Linkable; | |
| use yii\helpers\Url; | |
| /** | |
| * This is the resource class for model `common\models\EventSpan`. | |
| */ | |
| class EventSpanResource extends EventSpan implements Linkable | |
| { | |
| public function getLinks() | |
| { | |
| return [ | |
| Link::REL_SELF => Url::to(['event-span/view', 'id' => $this->id], true), | |
| 'index' => Url::to(['event-span/index'], true), | |
| ]; | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getParticipants() | |
| { | |
| return $this->hasMany(ParticipantResource::className(), ['id' => 'participant_id'])->viaTable('{{%participant_event_span}}', ['event_span_id' => 'id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getEvent() | |
| { | |
| return $this->hasOne(EventResource::className(), ['id' => 'event_id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getMeetings() | |
| { | |
| return $this->hasMany(MeetingResource::className(), ['event_span_id' => 'id']); | |
| } | |
| } |