I have a matrix field set up as global (
Inside each matrix block there is a SuperTable (
On each row in the SuperTable there is a lightswitch (
I need to toggle the lightswitch programatically for each row.
Looking at the SuperTable and Craft docs, I still can't make heads or tails of this. Can anyone help?
Ended up with a poor man's solution by going directly to the table and editing the column. Would still love to know how to do this "properly, though.
$disable = StcThreePairs::find() ->where(['elementId' => $pair->id]) ->one(); $disable->field_active = 0; $disable->save();