l3pp4rd/DoctrineExtensions — Issue #260: The annotation "@Gedmo\Mapping\Annotation\TranslationEntity" does not exist
Author: booradleys
Created: 2012-02-04 20:07:02+00:00
State: open

Hi there,
I got the following error:

#0 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\DocParser.php(375): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
#1 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\DocParser.php(302): Doctrine\Common\Annotations\DocParser->Annotation()
#2 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\DocParser.php(182): Doctrine\Common\Annotations\DocParser->Annotations()
#3 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\AnnotationReader.php(230): Doctrine\Common\Annotations\DocParser->parse('/**? * Country?...', 'class Entity\Co...')
#4 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\vendor\doctrine-common\lib\Doctrine\Common\Annotations\CachedReader.php(80): Doctrine\Common\Annotations\AnnotationReader->getClassAnnotations(Object(ReflectionClass))
#5 F:\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\Driver\AnnotationDriver.php(128): Doctrine\Common\Annotations\CachedReader->getClassAnnotations(Object(ReflectionClass))
#6 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\Driver\DriverChain.php(75): Doctrine\ORM\Mapping\Driver\AnnotationDriver->loadMetadataForClass('Entity\Country', Object(Doctrine\ORM\Mapping\ClassMetadata))
#7 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php(281): Doctrine\ORM\Mapping\Driver\DriverChain->loadMetadataForClass('Entity\Country', Object(Doctrine\ORM\Mapping\ClassMetadata))
#8 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php(170): Doctrine\ORM\Mapping\ClassMetadataFactory->loadMetadata('Entity\Country')
#9 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\EntityManager.php(257): Doctrine\ORM\Mapping\ClassMetadataFactory->getMetadataFor('Entity\Country')
#10 F:\ZEND\APPLICATIONS\exotica\zf2\module\DoctrineORMModule\vendor\doctrine-orm\lib\Doctrine\ORM\EntityManager.php(574): Doctrine\ORM\EntityManager->getClassMetadata('Entity\Country')
#11 F:\ZEND\APPLICATIONS\exotica\zf2\module\Zone\src\Zone\Model\Service\PaysService.php(10): Doctrine\ORM\EntityManager->getRepository('Entity\Country')

Entity\Country.php:

namespace Entity;

use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;

/**
* Country
*
* @ORM\Table(name="country")
* @ORM\Entity(repositoryClass="Repository\CountryRepository")
* @Gedmo\TranslationEntity(class="Entity\Translation\CountryTranslation")
*/
class Country
{
...
/**
* @var string $name
* @Gedmo\Translatable
* @ORM\Column(name="name", type="string", length=255, nullable=true)
*/
private $name;
...
}

Entity\CountryTranslation.php:

namespace Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Translatable\Entity\MappedSuperclass\AbstractPersonalTranslation;

/**
* @ORM\Entity
* @ORM\Table(name="country_translations",
* uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
* "locale", "object_id", "field"
* })}
* )
*/
class CountryTranslation extends AbstractPersonalTranslation
{
...
}

Can you tell me what's wrong ?