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

Subqueries in BaseBuilder #2001

Merged
merged 2 commits into from Sep 2, 2019
Merged

Subqueries in BaseBuilder #2001

merged 2 commits into from Sep 2, 2019

Conversation

iRedds
Copy link
Collaborator

@iRedds iRedds commented May 12, 2019

Description
Added subqueries via anonymous function in Query Builder for BaseBuilder::where() and BaseBuilder::whereIn() methods

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

Signed-off-by: Andrey Pyzhikov <5071@mail.ru>
Copy link
Member

@lonnieezell lonnieezell left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the thorough PR! I have just one small comment to address then I'll be happy to merge.

if ($values instanceof Closure)
{
$builder = clone $this;
$builder->from([], true)->resetQuery();
Copy link
Member

Choose a reason for hiding this comment

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

Since we're using this same code in 2 places, we should refactor those out into their own method to make future maintenance simpler

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

made it

Signed-off-by: Andrey Pyzhikov <5071@mail.ru>
@jim-parry
Copy link
Contributor

Looks good to me.

@lonnieezell lonnieezell merged commit 6e060d7 into codeigniter4:develop Sep 2, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants