I use simplified_yaml mapping driver in my app and want to add multi-language support. So after enabling translatable extension doctrine throws exception:
{
exception: "Doctrine\Common\Persistence\Mapping\MappingException"
file: "/var/www/vendor/doctrine/persistence/lib/Doctrine/Common/Persistence/Mapping/MappingException.php"
line: 64
message: "No mapping file found named 'Translation.orm.yml' for class 'Gedmo\Translatable\Entity\Translation'."
}
It seems that extension works properly only with annotation driver. In Symfony you can specify driver for extension. If it's possible with Laravel it probably should be documented
Here is my doctrine.php
'managers' => [
'default' => [
'dev' => env('APP_DEBUG', false),
'meta' => env('DOCTRINE_METADATA', 'annotations'),
'connection' => env('DB_CONNECTION', 'mysql'),
'namespaces' => [
'App\Entities'
],
'paths' => [
config_path('orm') => 'App\Entities' ],
'repository' => App\Core\ORM\EntityRepository::class,
'proxies' => [
'namespace' => false,
'path' => storage_path('proxies'),
'auto_generate' => env('DOCTRINE_PROXY_AUTOGENERATE', false)
],
/*
|--------------------------------------------------------------------------
| Doctrine events
|--------------------------------------------------------------------------
|
| The listener array expects the key to be a Doctrine event
| e.g. Doctrine\ORM\Events::onFlush
|
*/
'events' => [
'listeners' => [],
'subscribers' => []
],
'filters' => [],
/*
|--------------------------------------------------------------------------
| Doctrine mapping types
|--------------------------------------------------------------------------
|
| Link a Database Type to a Local Doctrine Type
|
| Using 'enum' => 'string' is the same of:
| $doctrineManager->extendAll(function (\Doctrine\ORM\Configuration $configuration,
| \Doctrine\DBAL\Connection $connection,
| \Doctrine\Common\EventManager $eventManager) {
| $connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
| });
|
| References:
| http://doctrine-orm.readthedocs.org/en/latest/cookbook/custom-mapping-types.html
| http://doctrine-dbal.readthedocs.org/en/latest/reference/types.html#custom-mapping-types
| http://doctrine-orm.readthedocs.org/en/latest/cookbook/advanced-field-value-conversion-using-custom-mapping-types.html
| http://doctrine-orm.readthedocs.org/en/latest/reference/basic-mapping.html#reference-mapping-types
| http://symfony.com/doc/current/cookbook/doctrine/dbal.html#registering-custom-mapping-types-in-the-schematool
|--------------------------------------------------------------------------
*/
'mapping_types' => [
//'enum' => 'string'
]
]
],
I use simplified_yaml mapping driver in my app and want to add multi-language support. So after enabling translatable extension doctrine throws exception:
It seems that extension works properly only with annotation driver. In Symfony you can specify driver for extension. If it's possible with Laravel it probably should be documented
Here is my doctrine.php
Here is my Category.orm.yml