title: How to print translatable data in sonata admin with DoctrineBehaviors from kpnlabs
body: <p>I'm just looking the good way to use DoctrineBehaviors by knplabs.</p>
  
  <p>I have allready render a form in sonata admin bundle with the help of this bundle : <a href="https://github.com/a2lix/TranslationFormBundle" rel="nofollow">https://github.com/a2lix/TranslationFormBundle</a></p>
  
  <p>Now, i want to have my translated field in the admin list.</p>
  
  <p>At this time, it's work with this method:</p>
  
  <pre><code>/**
   * @ORM\Entity
   * @ORM\Table(name="sport") 
   */
  
  class Sport
  {
  ...
  
      public function getNom(){
          return $this-&gt;translate()-&gt;getNom();
      }
  }
  </code></pre>
  
  <p>It's work but, i have to remap all the translated field in the original entity. I'm pretty sure i'm missing something, particularly with the <em>magic</em> of the proxy translations.</p>
  
  <p><strong>UPDATE:</strong> </p>
  
  <pre><code>class Sport
  {
  
      use \Knp\DoctrineBehaviors\Model\Translatable\Translatable;
  
      public function __call($method, $arguments)
      {
          return $this-&gt;proxyCurrentLocaleTranslation($method, $arguments);
      }   
      /**
       * @ORM\Column(type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      // Need this method for the admin list template
      public function getNom(){
           return $this-&gt;translate()-&gt;getNom();
      }
  
      // Work even the precedent method not here, the proxy call work fine.
      public function __toString(){
           return $this-&gt;getNom();
      }
  }
  
  class SportTranslation
  {
      use ORMBehaviors\Translatable\Translation;
  
      /**
       * @ORM\Column(type="string", length=255)
       */
      protected $nom;
  
      /**
       * @return string
       */
      public function getNom()
      {
          return $this-&gt;nom;
      }
  
      /**
       * @param  string
       * @return null
       */
      public function setNom($nom)
      {
          $this-&gt;nom = $nom;
      }
  }
  </code></pre>
  
  <p>Thanks for your fast reply @nifr! The proxy Method work in a controller (i try on the __toString Method of sport, it's work fine). </p>
  
  <p>But the issue apparently coming from sonata admin bundle, i check the template code, don't know why it doesn't work.</p>
  
  <p>I will keep the ugly method until i finda better solution.</p>
  
  <p>At this time it's the only way to print value in the admin list template.</p>
  
  <p>If i find something better i will update this post.</p>