Allow 0 id for Entity #501

Merged
merged 2 commits into from Nov 5, 2012

Conversation

Projects
None yet
4 participants
@jeremymarc
Contributor

jeremymarc commented Nov 5, 2012

When using a 0 id, it's throwing InvalidArgumentException (Binding entities to query parameters only allowed for entities that have an identifier.) 

Allow 0 id for Entity
When using a 0 id, it's throwing InvalidArgumentException (Binding entities to query parameters only allowed for entities that have an identifier.) 
@doctrinebot

This comment has been minimized.

Show comment Hide comment
@doctrinebot

doctrinebot Nov 5, 2012

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:

http://doctrine-project.org/jira/browse/DDC-2122

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:

http://doctrine-project.org/jira/browse/DDC-2122

@stof

View changes

lib/Doctrine/ORM/AbstractQuery.php
@@ -281,7 +281,7 @@ private function convertObjectParameterToScalarValue($value)
$value = $values[$class->getSingleIdentifierFieldName()];
- if ( ! $value) {
+ if ( ! isset($value)) {

This comment has been minimized.

Show comment Hide comment
@stof

stof Nov 5, 2012

Member

Please check null !== $value instead. Using isset($value) looks weird to me as the variable is defined.

@stof

stof Nov 5, 2012

Member

Please check null !== $value instead. Using isset($value) looks weird to me as the variable is defined.

@jeremymarc

This comment has been minimized.

Show comment Hide comment
@jeremymarc

jeremymarc Nov 5, 2012

Contributor

@stof done

Contributor

jeremymarc commented Nov 5, 2012

@stof done

guilhermeblanco added a commit that referenced this pull request Nov 5, 2012

@guilhermeblanco guilhermeblanco merged commit ff80e99 into doctrine:master Nov 5, 2012

1 check failed

default The Travis build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment