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

User::exists() overrides Builder::exists() leading to unexpected behavior #771

Closed
alexweissman opened this issue Jul 15, 2017 · 1 comment
Labels
architecture Related to the framework architecture user experience The one using UF

Comments

@alexweissman
Copy link
Member

We implement a User::exists($value, $identifier = 'user_name', $checkDeleted = true), which overrides the base exists method in Builder.

This can lead to confusion though, because the signatures of the two methods are different, and they operate on different assumptions. User::exists is implicitly generating a where query, whereas Builder::exists simply determines whether or not the current query returns any results.

The fix for this would be to rename User::exists to something else. We could also implement this at the level of Model, rather than just for the User class.

@alexweissman alexweissman added architecture Related to the framework architecture user experience The one using UF labels Jul 15, 2017
@alexweissman
Copy link
Member Author

Ok, I've addressed this in v4.1.7 (e5f5487) by deprecating the User::exists method and replacing it with the findUnique method for all models. We can't get rid of User::exists right away as some people may be depending on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Related to the framework architecture user experience The one using UF
Projects
None yet
Development

No branches or pull requests

1 participant