i make translatable behavior entities using metadata.
i have class article
class article implements translatableinterface { /** * @heidantranslatable */ private $title; /** * @heidanlocale */ private $locale; public function gettitle() { return $this->title; } public function settitle($title) { $this->title = $title; return $this; } public function getlocale() { return $this->locale; } public function setlocale($locale) { $this->locale = $locale; return $this; }
i have kind of gedmo doctrine extension behavior create in database columns depending on property , allowed locales.
for example, entity article, 2 columns created : title_fr, title_en.
i'd stuff bridged doctrine behavior , made loadclassmetadatalistener
class loadclassmetadatalistener { /** * @param loadclassmetadataeventargs $eventargs */ public function loadclassmetadata(loadclassmetadataeventargs $eventargs) { $metadata = $eventargs->getclassmetadata(); $metadata ->mapfield(array('fieldname' => 'title_fr', 'type' => 'text')) ; }
when run doctrine:schema:update --force have following error :
[reflectionexception]
property heidan\corebundle\entity\article::$title_fr not exist
so guess said property title_fr not exist, , that's right.
i not want set manually properties (private $title_fr, private $title_en, private $content_fr, private $content_en) entities.
is there way achieve behavior far ?
thanks lot help.