I use doctrine translatable and I have an entity that has a translatable attribute. It looks like this.
class Scaleitem
{
use ORMBehaviors\Translatable\Translatable;
protected $id;
}
And I have a ScaleitemTranslation file:
class ScaleitemTranslation
{
use ORMBehaviors\Translatable\Translation;
protected $text;
public function setText($text)
{
$this->text = $text;
return $this;
}
public function getText()
{
return $this->text;
}
}
I would like to access the text from the controller:
$item = $em->getRepository('AppMyBundle:Scaleitem')->find(1);
dump($item->getText());
This does not work. Will someone tell me my problem?
source
share