Skip to content
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

How can I access class in typecast method? #172

Closed
ljuba-roofr opened this issue Feb 21, 2024 · 2 comments
Closed

How can I access class in typecast method? #172

ljuba-roofr opened this issue Feb 21, 2024 · 2 comments

Comments

@ljuba-roofr
Copy link

I'm looking at docs for Column wrappers and typecast and User and Uuid example and I see that castValue method has 2 arguments

public static function castValue(string $value, DatabaseInterface $db): static

Is there a way to access User properties inside Uuid->castValue method? For example, can I get user id inside the castValue?

@roxblnfk
Copy link
Member

Pay attention to typecast handlers
There you may handle all entity fields in one method

@ljuba-roofr
Copy link
Author

Great. Thanks for the help!

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

No branches or pull requests

2 participants