data array

Can someone help me how I can do something like, this

7196

data array.PNG

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

I do not know whether I understand your problem correctly… Why don’t you build a next relatation like the current model <-> InspectionMapping and then use it within the current model like a normal relation?

Please I don’t understand what you mean. I’ve tried several times and the error is: “trying to… property of non-object”. That’s why I put the screen shot of what I want to do. I’ve spent about two weeks now. Please just help with a sample. Thanks