i've tried to integrate the Gedmo Translatable Extension in Doctrine 2.2/Zend, but I didn't succeed and need some help. I'm always getting this fatal error:
Uncaught exception 'Doctrine\ORM\Mapping\MappingException' with message 'Class AliasStaticPage is not a valid entity or mapped super class.' in[...]library/Doctrine/ORM/Mapping/MappingException.php:147
APC is running, Doctrine 2.2 worked also fine (before).
This is my Bootstrap (similar to Best practices for setting up with annotations):
$cache = new \Doctrine\Common\Cache\ApcCache();
$config->setQueryCacheImpl($cache);
$config->setResultCacheImpl($cache);
$config->setMetadataCacheImpl($cache);
$config->setProxyNamespace('App\Proxies');
$annotationReader = new Doctrine\Common\Annotations\AnnotationReader();
Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace(
'Gedmo\Mapping\Annotation',
'../library/DoctrineExtensions/Gedmo'
);
Doctrine\Common\Annotations\AnnotationRegistry::registerFile(
'../library/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
);
$chainDriverImpl = new \Doctrine\ORM\Mapping\Driver\DriverChain();
$annotationDriver = new Doctrine\ORM\Mapping\Driver\AnnotationDriver($annotationReader,
array(
APPLICATION_PATH . '/models',
'../library/DoctrineExtensions/Gedmo/Translatable/Entity'
));
$chainDriverImpl->addDriver($annotationDriver, 'Entity');
$chainDriverImpl->addDriver($annotationDriver, 'Gedmo\Translatable\Entity');
$config->setMetaDataDriverImpl($chainDriverImpl);
and here are parts of the class definition:
<?php
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="alias")
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorMap({"aliasProject" = "AliasProject",
* "aliasStaticPage" = "AliasStaticPage"})
*/
abstract class Alias
{
/**
* @Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
[...]
}
And the joined class:
<?php
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="aliasStaticPage")
*/
class AliasStaticPage extends Alias
{
/**
* @ManyToOne(targetEntity="StaticPage")
* @JoinColumns({@JoinColumn(name="staticPage_id", referencedColumnName="id")})
*/
private $staticPage;
[...]
}
I've also tried this approach on doctrine-project.org without success...
Many thanks for any ideas.