Skip to content

Use getFieldValue and setFieldValue methods #2966

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ker0x
Copy link

@ker0x ker0x commented Jul 1, 2025

Replace call to getReflectionProperty($field)->getValue($entity) and getReflectionProperty($field)->setValue($entity, $value) with getFieldValue() and setFieldValue() methods which are available in both ORM 2.x and 3.x

This makes it possible to use the new propertyAccessor property introduced in ORM 3.4 and fallback to reflFields with ORM < 3.4

PR contain patch #2945 and also fix #2965

@ker0x ker0x force-pushed the get-set-field-value branch from beb13b3 to 7f1cdf6 Compare July 1, 2025 22:24
@ker0x ker0x marked this pull request as ready for review July 1, 2025 22:24
@ker0x ker0x force-pushed the get-set-field-value branch from 7f1cdf6 to f12ac1e Compare July 1, 2025 22:34
@mbabker
Copy link
Contributor

mbabker commented Jul 1, 2025

Can you add a test fixture covering the "generate a slug using an embeddable object" scenario? It looks like all the tests only use fields directly on the model and nothing with a relation or embed, so it'd probably be good to have this covered as well.

@ker0x
Copy link
Author

ker0x commented Jul 2, 2025

@mbabker test added 👍 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sluggable] Type error when generating slug using embedded properties and ORM 3.4
3 participants