Skip to content

How to extend model & override findFirst() #15514

Answered by rudiservo
quasipickle asked this question in Q&A
Discussion options

You must be logged in to vote

I would use a query builder honestly.
We can either consider this a bug or we accept that since it is in v4 this a breaking change so v4 is actually ok with the versioning.
The manual however is not ok since it says it can be done.

IMO hydration into array should not be used directly the model::find, it promotes inconsistency and it might break a lot of things, also adds a lot more checks just to handle those cases, not only consuming more cycles but also giving it more room to generate problems.
Things should be has statically typed has possible, it's easier on codding, IDE, internal checks, etc.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@quasipickle
Comment options

@rudiservo
Comment options

@quasipickle
Comment options

Answer selected by quasipickle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants