Shanty-Mongo
Shanty-Mongo copied to clipboard
Notice: Indirect modification of overloaded property
Hi All,
When I attempt to do the following operation:
$elb = new Elb();
$instanceId = 'someID';
$elb->instances->$instanceId = new Shanty_Mongo_Document();
$elb->instances->$instanceId->desc = 'some desc';
$elb->instances->$instanceId->state = 'some state';
$elb->save();
I get the following php error:
Notice: Indirect modification of overloaded property
Is there any way around this?
Hi Valeeum,
I would sugest you try accessing your sub document like this:
$elb->instances[$instanceId]
Coen
Same issue. One workaround is building an $instances document and then setting:
$elb->instances = $instances;
But I would love if there would be a consistent way of doing this so that I can dynamically do this stuff in loops.