mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-385: Change behaviour if fully qualified classname is passed in as string #479
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 (Mar 1, 2010).
Jira issue originally created by user shurakai:
If one calls $em->getRepository('\Entity') (leading \ !) then Doctrine's behaviour is quite undefined, as it would result e.g. in a "mapping file '.entity.dcm.yml' not found" error. (leading dot!)
PHP, however, seems to allow the leading , but Doctrine does not. In fact, the leading \ is not necessary as classnames in strings are always fully qualified.
So Doctrine should either:
1.) Throw an exception stating that using a leading backslash is prohibited
2.) Simply strip it.
@doctrinebot commented on GitHub (Mar 1, 2010):
Comment created by @beberlei:
I vote for 1. Stripping the char just leads to major overhead given that getMetadataFor is one of the most called functions in Doctrine 2.
@doctrinebot commented on GitHub (Aug 8, 2010):
Comment created by romanb:
Fixed.
@doctrinebot commented on GitHub (Aug 8, 2010):
Issue was closed with resolution "Fixed"