Guys,
I have a Mongodb ActiveRecord.When I try to do this inside of ActiveRecord
$this->blocks[$block->id]=$block
I got
Indirect modification of overloaded property app\models\ActiveRecord\Page::$blocks has no effect
I think it’s because properties in ActiveRecords isn’t real properties. So I add a public property to ActiveRecord like this:
public $blocks = [];
and error has been gone but blocks not saving in Db.