mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1595: Wrong count in relation with inheritance #1998
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 11, 2012).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user ghennady:
I have some code like this:
@doctrinebot commented on GitHub (Jan 11, 2012):
@doctrinebot commented on GitHub (Jan 13, 2012):
Comment created by @guilhermeblanco:
How can this be returning you incorrect values for count?
The second query retrieves based on the join table, which is supposed to have only the linking between Container and News.
It is expected that given a Container ID, all you want to know is the actual number of associated News, which a simple check to join table is enough, no matter which inheritance strategy you are looking into.
Marking ticket as invalid.
Provide better information and explain how it is affecting you if my explanation is not enough.
@doctrinebot commented on GitHub (Jan 13, 2012):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Jan 13, 2012):
Comment created by ghennady:
Thank you for your comprehensive answer. My fault, I may not be correctly described the problem.
As I understood from you answer, the following code is not correct
in other words in the table resource_path can not be at the same time records linking Container with Container and Container with News.
@doctrinebot commented on GitHub (Jan 13, 2012):
Comment created by alex_pogodin:
The problem here is that
resource_pathknows nothing about type of the resource. At the same time, news collection contains only objects ofresource.type == 'news'. That means, that if there' not only news inside container, but, probably another container(s), the$news->count()will return incorrect value (the sum of news and containers counts). That's the point.@doctrinebot commented on GitHub (Sep 4, 2012):
Comment created by i_yuki_i@hotmail.com:
Should this:
be:
Looks like parent columns is missing alias. Is that correct?
@doctrinebot commented on GitHub (Apr 29, 2014):
Comment created by deatheriam:
Similar issue is described in http://www.doctrine-project.org/jira/browse/DDC-3104