-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transforming Request Data into Entity Properties - unclear #7889
Comments
How are you marshalling data into your entity? Is |
Normal
No, it isn't |
Is |
|
The field transformer won't run then. Field marshalling only happens for fields that exist in the data being set into the entity. |
See https://github.com/dereuromark/cakephp-tools/blob/a917b0d2bf2721a083d44b89c0ea53e0221c9db5/src/Model/Behavior/SluggedBehavior.php#L219 for how you can add a slug into the entity based on certain other fields present when the callback is run. |
Hi everyone
Please clarify the documentation for Transforming Request Data into Entity Properties. Currently it's unclear how to get the custom fields from Behaviour into Entities of the Table said Behaviour is attached to. It only shows a small snippet out of context.
I created a behaviour and copied that snipet from documentation.
When I call
->slug
on an entity, I get anull
. I'm clearly missing something, but I can't understand what from the documentation.Additional resources I checked:
The text was updated successfully, but these errors were encountered: