mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-907: Allowing overriding of Mapping\ClassMetaData #1125
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 (Dec 1, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user juzna:
When overriding class ClassMetadata for making customized mapping, its now not possible to use own reflection implementation, because ClassMetadata and ClassMetadataInfo implementation creates reflection classes directly.
I'm proposing a patch, which will allow for for a class overloading ClassMetadata to create it's own reflection.
The code needed to do so would be:
class MySuperClassMetadata extends \Doctrine\ORM\Mapping\ClassMetadata {
... my code
public function getReflectionClass() {
if(!$this->reflClass) {
$this->reflClass = new MySuperReflectionClass($this->name);
}
return $this->reflClass;
}
public function _getNewReflectionProperty($class, $property) {
return new MySuperReflectionProperty($class, $property);
}
}
Which also much simplifies code from this article: http://www.doctrine-project.org/blog/your-own-orm-doctrine2
(Hope it's OK, I'm not much familiar with contributing to open source projects yet)
@doctrinebot commented on GitHub (Dec 2, 2010):
Comment created by @beberlei:
This was implemented with DDC-897.
@doctrinebot commented on GitHub (Dec 2, 2010):
Comment created by juzna:
DDC-897 allowed overriding, but does not support simple overriding of reflection. My proposed patches considers only reflection overloading.
(Which is needed for ActiveEntity implementation as mentioned in that article).
@doctrinebot commented on GitHub (Apr 20, 2012):
Comment created by juzna:
not relevant anymore
@doctrinebot commented on GitHub (Apr 20, 2012):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/4e41ea67cae3fcf3a2a5