Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 9 |
| OrganizationProfileResource | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6.00 | |
0.00% |
0 / 9 |
| getLinks | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 6 |
|||
| getOrganizations | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 3 |
|||
| <?php | |
| namespace api\modules\v1\models; | |
| use common\models\OrganizationProfile; | |
| 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\OrganizationProfile`. | |
| */ | |
| class OrganizationProfileResource extends OrganizationProfile implements Linkable | |
| { | |
| public function getLinks() | |
| { | |
| return [ | |
| Link::REL_SELF => Url::to(['organization-profile/view', 'id' => $this->id], true), | |
| 'index' => Url::to(['organization-profile/index'], true), | |
| ]; | |
| } | |
| /** | |
| * @return \yii\db\ActiveQuery | |
| */ | |
| public function getOrganizations() | |
| { | |
| return $this->hasMany(OrganizationResource::className(), ['organization_profile_id' => 'id']); | |
| } | |
| } |