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
Create queryBuilder from parts. #556
Conversation
Hello, thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link: |
👎 This shouldn't pollute EntityManager's public API. QueryBuilder::setDQLParts() would be more appropriate, but still, there is QueryBuilder::add() method. |
@jmikola Just adding every part from getDQLParts won't work. This makes rebuilding a querybuilder hard. |
{ | ||
if ($part) { | ||
if (is_array($part) && $name != 'join') { | ||
$part = current($part); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be reset
?
I moved it to the correct place, updated tests and applied coding standards. |
@NoUseFreak: Why did you tag me in this issue? Did you mean to respond to @Majkl578? |
ping |
@NoUseFreak why don't you do |
I don't think we want this feature, if you need to store a query you can store DQL instead. |
Hey ! i need this feature too Where i can find it ? |
@L0rD59 You can easily achieve it: $qb_new = clone $qb; |
thx for replies, In detail, i use Lexik FormFilter Bundle and PagerFanta Bundle and i mix both so i want persist the QB of Lexik when changing page. I use session for that but the QB Builder object can't persist in session, so i decide to persist QB->getParts() I can too persist QB->getDQL() Next, i need to transform QB->getParts() (or QB->getDQL()) to QB for PagerFanta bundle thx for your times. |
@L0rD59 Pagerfanta does not require you to use a query builder. It is able to paginate a Query object (actually, it only paginates Query objects as the first action done when using a QueryBuilder is doing a |
@stof thx ! it's work with Query ! |
Add a feature that can create a queryBuilder from queryBuilder parts.
This can be used when a query is build and needs to be stored somehow and restore it later.