title: DoctrineExtensions Notice: Undefined index: foreignKey in $em->getRepository('Gedmo\\Translatable\\Entity\\Translation');
body: <p>I try to save multiple translations like in this <a href="https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/translatable.md#example-of-multiple-translations" rel="nofollow">example</a>, but I have an error.</p>
  
  <p>here is entity </p>
  
  <pre><code>/**
   * @ORM\Entity
   * @Gedmo\TranslationEntity(class="BaseTranslation")
   * @ORM\Table(name="c_Base")
   */
  class Base {
  
      /**
       * @ORM\Column(type="bigint")
       * @ORM\Id
       */
      private $id;
  
      /**
       * Hexaid
       * @var string
       */
      private $hid;
  
      /**
       * @ORM\Column(type="string")
       * @GRID\Column(title="name")
       * @Gedmo\Translatable
       * @var string
       */
      private $name;
  
      /**
       * @ORM\Column(type="text", nullable=true)
       * @Gedmo\Translatable
       * @var string
       */
      private $description;
  
   /**
       * GRID\Column(title="translations",field="translations.content")
       * @ORM\OneToMany(
       *     targetEntity="BaseTranslation",
       *  mappedBy="object",
       *  cascade={"persist", "remove"}
       * )
       * @Assert\Valid(deep = true)
       */
      private $translations;
  </code></pre>
  
  <p>translation entity </p>
  
  <pre><code>/**
   * Entity\Translation\ProductTranslation.php
  
   * @ORM\Entity
   * @ORM\Table(name="c_base_translations",
   *   uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
   *     "locale", "object_id", "field"
   *   })}
   * )
   */
  class BaseTranslation extends AbstractPersonalTranslation{
      /**
       * @ORM\ManyToOne(targetEntity="Base", inversedBy="translations")
       * @ORM\JoinColumn(name="object_id", referencedColumnName="id", onDelete="CASCADE")
       */
      protected $object;
  
      public function __construct($locale, $field, $value)
      {
          $this-&gt;setLocale($locale);
          $this-&gt;setField($field);
          $this-&gt;setContent($value);
      }
  
  }
  </code></pre>
  
  <p>i try use multiple translations </p>
  
  <pre><code>  $em = $this-&gt;getDoctrine()-&gt;getManager();
          $repository = $em-&gt;getRepository('Gedmo\\Translatable\\Entity\\Translation');
  
          $article = new Base();
  
          $article-&gt;setName('content en');
  
          $repository-&gt;translate($article, 'name', 'de', 'name de')
              -&gt;translate($article, 'name', 'pl', 'name pl')
  
          ;
  
          $em-&gt;persist($article);
          $em-&gt;flush();
  </code></pre>
  
  <p>and get </p>
  
  <p>Notice: Undefined index: foreignKey</p>
  
  <pre><code>[1] Symfony\Component\Debug\Exception\ContextErrorException: Notice: Undefined index: foreignKey
      at n/a
          in /home/grek/PhpstormProjects/welasy/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 655
  
      at Symfony\Component\Debug\ErrorHandler-&gt;handleError('8', 'Undefined index: foreignKey', '/home/grek/PhpstormProjects/welasy/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php', '655', array('name' =&gt; 'foreignKey'))
          in /home/grek/PhpstormProjects/welasy/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php line 655
  
      at Doctrine\ORM\Mapping\ClassMetadataInfo-&gt;getReflectionProperty('foreignKey')
          in /home/grek/PhpstormProjects/welasy/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php line 80
  
      at Gedmo\Translatable\Entity\Repository\TranslationRepository-&gt;translate(object(Base), 'name', 'de', 'name de')
          in /home/grek/PhpstormProjects/welasy/vendor/Mea/CharterBundle/Controller/ResourcesController.php line 171
  
      at Mea\CharterBundle\Controller\ResourcesController-&gt;oneViewByHidAction('9888fff563a6a42', '2015;20')
          in  line 
  
      at call_user_func_array(array(object(ResourcesController), 'oneViewByHidAction'), array('9888fff563a6a42', '2015;20'))
          in /home/grek/PhpstormProjects/welasy/app/bootstrap.php.cache line 3028
  
      at Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(object(Request), '1')
          in /home/grek/PhpstormProjects/welasy/app/bootstrap.php.cache line 2990
  
      at Symfony\Component\HttpKernel\HttpKernel-&gt;handle(object(Request), '1', true)
          in /home/grek/PhpstormProjects/welasy/app/bootstrap.php.cache line 3139
  
      at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel-&gt;handle(object(Request), '1', true)
          in /home/grek/PhpstormProjects/welasy/app/bootstrap.php.cache line 2383
  
      at Symfony\Component\HttpKernel\Kernel-&gt;handle(object(Request))
          in /home/grek/PhpstormProjects/welasy/web/app_dev.php line 28
  </code></pre>