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

Model events why is there no beforeFind? #1527

Closed
bangbangda opened this issue Nov 23, 2018 · 3 comments
Closed

Model events why is there no beforeFind? #1527

bangbangda opened this issue Nov 23, 2018 · 3 comments

Comments

@bangbangda
Copy link
Contributor

I want to add a where condition before all finds(find findAll first).
for example,
$where = ['company_id' => session->get('company_id')];
default search for company data.

beforeFind event is ok?

@bangbangda bangbangda changed the title Model Events Why is there no beforeFind? Model events why is there no beforeFind? Nov 23, 2018
@lonnieezell
Copy link
Member

I guess that's a valid use. It seems to me like there would still be situations where you would want that. Personally, I'd just add a new method in the model, findForCompany($id) or something. That's more explicit.

@bangbangda
Copy link
Contributor Author

Ok. a good idea. Thank you.

@MGatner
Copy link
Member

MGatner commented Jul 17, 2020

#3344

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

3 participants