Hi Christophe,
i'm moving forward :)
i'm trying to set my Area::$name property translatable.
i added gedmo annotations to my class directly (see below). i use the Sonata
AdminBundle to edit my 'Area' object.
and the default saving still use the table 'name' field and not the
'ext_translation' table.
shall i surcharge the saving method in the admin ? do you have any idea ?
cheers
Benoît
------
<?php
>
> namespace Mr\StartBundle\Entity;
>
> use Doctrine\ORM\Mapping as ORM;
>
> use Gedmo\Mapping\Annotation as GEDMO;
> use Gedmo\Translatable\Translatable;
>
> /**
> * Mr\StartBundle\Entity\MrArea
> *
> * @ORM\Table(name="mr_area")
> * @ORM\Entity
> */
> class MrArea implements Translatable
> {
>
> /**
> * @var integer $id
> */
> private $id;
>
> /**
> * @var string $name
> *
> * @GEDMO\Translatable
> */
> private $name;
>
> /**
> * Used locale to override Translation listener`s locale
> * this is not a mapped field of entity metadata, just a simple
> property
> *
> * @GEDMO\Locale
> */
> private $locale;
>
> public function setTranslatableLocale($locale)
> {
> $this->locale = $locale;
> }
>
> ...
>
> }
>
2011/6/20 Christophe COEVOET <[email protected]>
> Le 17/06/2011 22:29, mrdev a écrit :
>
>> Hi there,
>>
>> since i decided to use the translatable feature of the Stof
>> \DoctrineExtensionsBundle i get this error
>>
>> [Doctrine\ORM\Mapping
>> \MappingException]
>> No identifier/primary key specified for Entity 'Stof
>> \DoctrineExtensionsBundle\**Entity\LogEntry'. Every Entity must have an
>> identifier/primary key.
>>
>> i tried everything i found on the web, playing with annotations and
>> the LogEntry class has protected id property inherited from
>> AbstractLogEntry (no private property)...
>>
>> i'm stuck.
>>
>> any help ?
>>
>> thanks
>>
>> Benoît
>>
>> This is a bug with the Doctrine EntityGenerator which has some issues
> with inheritance. The workaround is to disable the mapping of the bundle
> when you want to use the CLI command to generate your entities (disabling it
> is documented in the bundle doc) and to activate it again after running the
> command.
>
> --
> Christophe | Stof
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> symfony-users+unsubscribe@**googlegroups.com<symfony-users%[email protected]>
> For more options, visit this group at
> http://groups.google.com/**group/symfony-users?hl=en<http://groups.google.com/group/symfony-users?hl=en>
>
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en