doctrine/oxm

Compatibility with Doctrine Common

Closed this issue · 4 comments

PHPUnit 3.5.15 by Sebastian Bergmann.

............................................................... 63 / 158 ( 39%)
..........PHP Fatal error: Call to undefined method Doctrine\Common\Annotations\AnnotationReader::setDefaultAnnotationNamespace() in /var/local/olms.local/vendor/oxm/lib/Doctrine/OXM/Configuration.php on line 210

I use latest doctrine common (ae8493e66).

Tests fail because refactoring made in Doctrine common. setDefaultAnnotationNamespace() method doesn't exist anymore. Furthermore there are new methods added to several interfaces (listed below).

Doctrine\Common\Persistence\Mapping\ClassMetadataFactory

  • isTransient()

Doctrine\Common\Persistence\Mapping\ClassMetadata

  • getIdentifierFieldNames()
  • isAssociationInverseSide()
  • getAssociationMappedByTargetField()
  • getIdentifierValues()

Doctrine\Common\Persistence\ObjectManager

  • initializeObject()
  • contains()

Doctrine\Common\Persistence\ObjectRepository

  • getClassName()

I did some work on my fork to make it working with Doctrine 2.2 (installed via composer) but tests fail with older versions (installed via git submodules).

I also couldn't make it working without importing mapping namespace to the entities (use Doctrine\OXM\Mapping as OXM).

thank you! Great work! I'll test this as soon as possible!

Note that I just tried to see how much work is needed to make it working. I'm not sure if it's the right solution (that's why I didn't send PR).

I changed the reader class:

From Doctrine\Common\Annotations\AnnotationReader to Doctrine\Common\Annotations\SimpleAnnotationReader