Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 12 |
| OrganizationTableResource | |
0.00% |
0 / 1 |
|
0.00% |
0 / 3 |
12.00 | |
0.00% |
0 / 12 |
| getLinks | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 6 |
|||
| getOrganization | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| getTable | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| <?php | |
| namespace api\modules\v1\models; | |
| use common\models\OrganizationTable; | |
| 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\OrganizationTable`. | |
| */ | |
| class OrganizationTableResource extends OrganizationTable implements Linkable | |
| { | |
| public function getLinks() | |
| { | |
| return [ | |
| Link::REL_SELF => Url::to(['organization-table/view', 'id' => $this->id], true), | |
| 'index' => Url::to(['organization-table/index'], true), | |
| ]; | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getOrganization() | |
| { | |
| return $this->hasOne(OrganizationResource::className(), ['id' => 'organization_id']); | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getTable() | |
| { | |
| return $this->hasOne(TableResource::className(), ['id' => 'table_id']); | |
| } | |
| } |