mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Entity name with namespace change mapping #5383
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 @mirekratman on GitHub (Jan 13, 2017).
Originally assigned to: @Ocramius on GitHub.
When I create a query builder by using entity classname like:
and add a ordering
doctrine create the query (example)
when will use entity classname without namespace
query looks:
difference is
Annotation mapping look like this
@Ocramius commented on GitHub (Jan 13, 2017):
@mirekratman I don't understand
"when will use entity classname without namespace". What do you mean by "use" here? What is the$entity->getClassName()call?@mirekratman commented on GitHub (Jan 13, 2017):
@Ocramius Hi, $entity->getClassName() just return classname of entity simply using
return (string)get_class($this);which returnsCds\\Library\\Mysql\\Entity\\CdsDomainRegarding - "when will use" - wanted to say that problem happens when method ->orderBy() gets as a $sort parameter strng which contains classname with namespace
Cds\\Library\\Mysql\\Entity\\CdsDomaininstead of a simple string likeCdsDomain.I will prepare a simple entities and service to show the problem and will share a link here.
@lcobucci commented on GitHub (Jan 13, 2017):
@mirekratman but why are you using the class name as alias name on the query builder?
@mirekratman commented on GitHub (Jan 13, 2017):
@lcobucci good question - I can use any string like
abcof course, I've just used classname.Strange thing is Ive already did a separate unit tests but there I cannot simulate the issue yet.
In my project problem still exists - thats Ive also double checking my project.
Only one thing I have in mind now - maybe it has something very specific to do with parsing a query.
@mirekratman commented on GitHub (Jan 13, 2017):
The unit test (copy of the entities/repositories and method from service) can be fount here - https://github.com/mirekratman/tests - it passes corectly the test. The method with existing issue in my project is located in $this->domainService->getWrong(....). Still looking how to replicate this.
@mirekratman commented on GitHub (Jan 24, 2017):
Because Ive tried many times to replicate this issue and I couldnt do it, please close the ticket.
When I will find what is the problem then share more info in new ticket.
Thank you