Я попытался интегрировать Gedmo Translatable Extension в Doctrine 2.2/Zend, но мне это не удалось и вам нужна помощь. Я всегда получаю эту фатальную ошибку:Gedmo Переводимая интеграция в Doctrine 2.2/Zend
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 запущена, Doctrine 2.2 также работал отлично (раньше).
Это мой Bootstrap (по аналогии с 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);
и здесь является частью определения класса:
<?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;
[...]
}
И соединенным класс:
<?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 Мы также пробовали этот подход на doctrine-project.org без успеха ...
Большое спасибо за любые идеи.
Решите, но не можете ответить на мое решение не раньше 4 часов .. – theColaKid