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

Add callable support to $query->fetch() #5651

Merged
merged 5 commits into from
Sep 17, 2023

Conversation

adamkiss
Copy link
Contributor

@adamkiss adamkiss commented Sep 17, 2023

This PR …

This PR adds a support for type callable in the $database->fetch() method. This allows using existing functions/methods without having to rewrap them in a Closure.

// while having a class/function to render a database row
$query->fetch([SomeClass::class, 'renderRow'])->all();
$query->fetch('SomeClass::renderRow')->all()

Ready?

  • Unit tests for fixed bug/feature
  • In-code documentation (wherever needed)
  • Tests and checks all pass

For review team

Sorry, something went wrong.

adamkiss and others added 4 commits September 17, 2023 14:47
Test will have to wait until getkirby#5640 is accepted

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
lukasbestle
lukasbestle previously approved these changes Sep 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@distantnative distantnative merged commit 07383ef into getkirby:develop Sep 17, 2023
Copy link
Contributor Author

@adamkiss adamkiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can review?? (edit: GitHub confused me for a moment) :D

thanks for merging.

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

Successfully merging this pull request may close these issues.

None yet

3 participants