Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 26 |
| MeetingResource | |
0.00% |
0 / 1 |
|
0.00% |
0 / 7 |
56.00 | |
0.00% |
0 / 26 |
| fields | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 5 |
|||
| getLinks | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 6 |
|||
| getGuestParticipant | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getHostParticipant | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getTable | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getEventSpan | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getMeetingNotes | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| <?php | |
| namespace api\modules\v1\models; | |
| use common\models\Meeting; | |
| 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\Meeting`. | |
| */ | |
| class MeetingResource extends Meeting implements Linkable | |
| { | |
| // filter out some fields, best used when you want to inherit the parent implementation | |
| // and blacklist some sensitive fields. | |
| public function fields() | |
| { | |
| $fields = parent::fields(); | |
| // remove fields that contain sensitive information | |
| unset($fields['host_confirmation_token'], $fields['guest_confirmation_token']); | |
| return $fields; | |
| } | |
| public function getLinks() | |
| { | |
| return [ | |
| Link::REL_SELF => Url::to(['meeting/view', 'id' => $this->id], true), | |
| 'index' => Url::to(['meeting/index'], true), | |
| ]; | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getGuestParticipant() | |
| { | |
| return $this->hasOne(ParticipantResource::className(), ['id' => 'guest_participant_id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getHostParticipant() | |
| { | |
| return $this->hasOne(ParticipantResource::className(), ['id' => 'host_participant_id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getTable() | |
| { | |
| return $this->hasOne(TableResource::className(), ['id' => 'table_id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getEventSpan() | |
| { | |
| return $this->hasOne(EventSpanResource::className(), ['id' => 'event_span_id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getMeetingNotes() | |
| { | |
| return $this->hasMany(MeetingNoteResource::className(), ['meeting_id' => 'id']); | |
| } | |
| } |