dallu7020
(Jaiminmoslake7020)
1
Indirect modification of overloaded property ProjectMaster::$project_functionality has no effect
i have three relational table in innno db… one parent -> it’s child -> its child
when i try to
$modelA = ProjectMaster::model()->with('project_functionality.project_attachment')->findByPk($id);
for($i=0;$i<sizeof($modelA->project_functionality);$i++)
{
for($j=0;$j<sizeof($modelA->project_functionality[$i]->project_attachment);$i++)
{
$forThisRow = $modelA->project_functionality[$i]->project_attachment[$j];
$modelA->project_functionality[$i]->functionality_name = 'In Site Controller Index Action';
if($modelA->save())
{
echo 'yup';
}
else
{
echo 'nop';
}
}
}
Ankit_Modi
(Ankit Modi)
2
i think you can write a second loop is not correct way in last element not $i++ is $j++
for($j=0;$j<sizeof($modelA->project_functionality[$i]->project_attachment);$j++)
or if you want to store a multiple value using fooloop so you want to create the multiple object in forloop.
dallu7020
(Jaiminmoslake7020)
3
i dont think so that is problem… i checked it… and changed it and try it again… but it is not working…