mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-355: [Patch] Throw exception if class in DiscriminatorMap is unknown #441
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 (Feb 20, 2010).
Jira issue originally created by user shurakai:
Prevent Doctrine from triggering a "PHP Warning" in ClassMetaDataInfo if a class used within a discriminator map could not be loaded. Instead, throw an exception stating which class could not be found and where its used.
@doctrinebot commented on GitHub (Feb 23, 2010):
Comment created by romanb:
That would mean that *all* classes of a hierarchy are loaded whenever 1 is needed. Not sure thats a good idea. Maybe we can address that differently. Where is the php warning triggered exactly?
@doctrinebot commented on GitHub (Feb 23, 2010):
Comment created by shurakai:
Roman, this is already performed by calling is_subclass_of in ClassMetadataInfo, line 1437 (in setDiscriminatorMap() ). However, if there is no such class, a PHP Warning is triggered, but there is no usable debugging information provided. Therefore, throw an exception.
However, if you are not satisfied with the is_sbuclass_of call, please feel free to remove it and to mark this tacket as invalid. My patch was only intended to add the debug info.
@doctrinebot commented on GitHub (Feb 23, 2010):
Comment created by romanb:
I see, thats a pity but is_subclass_of is necessary. I will apply your patch a bit differently to avoid some unnecessary calls. Thanks!
@doctrinebot commented on GitHub (Feb 23, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/b111e8547eb6b8949b51