Can someone help me how I can do something like, this
7196
model::InspectionMapping
public function attributeLabels()
{
return [
'inspection_mapping_id' => 'Inspection Mapping ID',
'building_id' => 'Building ID',
'tariff_id' => 'Tariff ID',
'fee_id' => 'Fee ID',
'company_id' => 'Company ID',
'zone_id' => 'Zone ID',
'mapping_date' => 'Mapping Date',
];
}
public function getBuilding()
{
return $this->hasOne(Building::className(), ['building_id' => 'building_id']);
}
public function getTariff()
{
return $this->hasOne(BuildingTariff::className(), ['tariff_id' => 'tariff_id']);
}
public function getFee()
{
return $this->hasOne(Fee::className(), ['fee_id' => 'fee_id']);
}
public function getZone()
{
return $this->hasOne(Zone::className(), ['zone_id' => 'zone_id']);
}
public function getInspector()
{
return $this->hasOne(Inspector::className(), ['company_id' => 'company_id']);
}
Am getting the dropdown value for inspector from
[b]model:Inspector
attributes:company_id, inspector_name[/b]
I want to get the values(apart from company_id which is set to 0 by default) for the above diagram from model::InspectionMapping and update the same model with the value of company_id.
Please help me. Am in real trouble