Get values from relationship properties.
I have a form where I have a fieldset of a relationship. I would like to know if there's a way I can get these values inside the handleRecordUpdate method. I don't want it to save the relationship automatically because it has to go through the repository first. Thanks
7 Replies
I you're using
handleRecordUpdate()
, I think the fieldset data should be in the $data
parameter, try dd($data)
Yes, they are, but the relationship data that is inside the Field does not come with it
I think I don't fully understand... can you show me the code for the fieldset and what you are missing in
$data
?
Doh, ok I think I get it.
Read the relationship from $this->data
instead of $data
Using $this->data worked, it showed the values of the relationship. So I have a question. When I use $this->data is it already serialized after validation?
Maybe someone else can confirm but no, I think
$this->data
is the raw data, before validationI don't think so either, but it's good to be sure. I'll wait until someone else speaks. But thanks for the tip
$this->form->getState() will get the data and run the validations.