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

Database access from customController #815

Closed
mevdschee opened this issue Oct 26, 2021 · 2 comments
Closed

Database access from customController #815

mevdschee opened this issue Oct 26, 2021 · 2 comments
Assignees

Comments

@mevdschee
Copy link
Owner

@zemian I noticed that the signature of the customController should be improved (for more flexibility and database access). I will merge this, make the adjustment and make a minor release with a breaking change. Current:

new $className($router, $responder, $records);

proposed:

new $className($router, $responder, $db, $reflection, $cache);

You can then:

$records = new RecordService($db, $reflection);
$definition = new DefinitionService($db, $reflection);

And do everything that the other controllers do.

What do you think?

@zemian
Copy link
Contributor

zemian commented Oct 26, 2021

Hey Maurits, yeah the new proposed signature looks good! Thanks for taking my inputs!

@mevdschee
Copy link
Owner Author

See: v2.13.0

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

No branches or pull requests

2 participants