-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[ResourBundle] The criteria don't care about empties values #1487
Conversation
arnolanglade
commented
May 10, 2014
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Fixed tickets | - |
License | MIT |
Doc PR | - |
This is not proper fix IMO. There are for sure cases when you want to look for |
Agree for |
Perhaps, I should only use |
@Arn0d IMO this should be same as i.e. in '' !== $value && null !== $value |
@stloyd yes I will only use |
@Sylius/core-team Are you agree ? |
@@ -161,12 +161,12 @@ protected function applyCriteria(QueryBuilder $queryBuilder, array $criteria = n | |||
if (null === $value) { | |||
$queryBuilder | |||
->andWhere($queryBuilder->expr()->isNull($this->getPropertyName($property))); | |||
} elseif (!is_array($value)) { | |||
} elseif(is_array($value)) { |
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.
} elseif (is_array($value)) {
@umpirsky elseif (!is_array($value)) {
$queryBuilder
->andWhere($queryBuilder->expr()->eq($this->getPropertyName($property), ':' . $property))
->setParameter($property, $value);
} else {
$queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), $value));
} And now, it is : } elseif(is_array($value)) {
$queryBuilder->andWhere($queryBuilder->expr()->in($this->getPropertyName($property), $value));
} elseif ('' !== $value) {
$queryBuilder
->andWhere($queryBuilder->expr()->eq($this->getPropertyName($property), ':' . $property))
->setParameter($property, $value);
} |
@Arn0d Saša is not talking about your change was wrong or not, he just points you to fix CS (note missing space between |
OK! Done! |
:) |
ping @pjedrzejewski |
@pjedrzejewski Are you agree with this? I need it for a project ! Can we merge it ? |
[ResourBundle] The criteria don't care about empties values
Thank you Arnaud! |
You're welcome! |
[ResourBundle] The criteria don't care about empties values