Mutate relation data before save
I'm trying to mutate my data of a relationmanager before I save the records (attach).
The attach should get an extra parameter of the 'parent' in the relation that has some data, so I can save/mutate the data. It should also hook into another function so that I can update other data. For example;
In the relation manager I have this;
I don't see any DD being triggered here. I want, when the user presses attach, that there is data being added to the attaching object. Plus that there is another function that is being called to "sync" other data. Any ideas?
4 Replies
i think it should be before() instead
there is no data to fill the form with on the AttachAction
I've modified the code slightly, it now looks like this;
However, the
$this->ownerRecord->zone_id
doesn't work, since it's using $this when not in object context
it works when I fill in a static number, so I just need some way to get the "base" model data in thereAwesome! That works! Thanks ❤️