Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 27
OrganizationResource
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 8
72.00
0.00% covered (danger)
0.00%
0 / 27
 getLinks
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 6
 getOrganizationProfile
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getOrganizationType
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getEvent
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getSupervisor
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getActivityAreas
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getTables
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
 getParticipants
0.00% covered (danger)
0.00%
0 / 1
2.00
0.00% covered (danger)
0.00%
0 / 3
<?php
namespace api\modules\v1\models;
use common\models\Organization;
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\Organization`.
 */
class OrganizationResource extends Organization implements Linkable
{
    public function getLinks()
    {
        return [
            Link::REL_SELF => Url::to(['organization/view', 'id' => $this->id], true),
            'index' => Url::to(['organization/index'], true),
        ];
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getOrganizationProfile()
    {
        return $this->hasOne(OrganizationProfileResource::className(), ['id' => 'organization_profile_id']);
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getOrganizationType()
    {
        return $this->hasOne(OrganizationTypeResource::className(), ['id' => 'organization_type_id']);
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getEvent()
    {
        return $this->hasOne(EventResource::className(), ['id' => 'event_id']);
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getSupervisor()
    {
        return $this->hasOne(SupervisorResource::className(), ['id' => 'supervisor_id']);
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getActivityAreas()
    {
        return $this->hasMany(ActivityAreaResource::className(), ['id' => 'activity_area_id'])->viaTable('{{%organization_activity_area}}', ['organization_id' => 'id']);
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getTables()
    {
        return $this->hasMany(TableResource::className(), ['id' => 'table_id'])->viaTable('{{%organization_table}}', ['organization_id' => 'id']);
    }
    /**
     * @return \yii\db\ActiveQuery
     */
    public function getParticipants()
    {
        return $this->hasMany(ParticipantResource::className(), ['organization_id' => 'id']);
    }
}