title: Symfony2 Doctrine OneToMany Error
body: <p>I have a big understanding problem with OneToMany Relationship - i searched a lot but that didnt help, maybe someone can help me with this.</p>
  
  <p>I have a Event Entity with OneToMany Relation</p>
  
  <pre><code>&lt;?php
  
  namespace #\#\#;
  
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  use Turmforum\BookingBundle\Entity\Contact;
  
  /**
   * Event
   *
   * @ORM\Table(name="events")
   * @ORM\Entity
   */
   class Event
   {
  /**
   * @var integer
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  private $id;
  
  /**
   * @ORM\OneToMany(targetEntity="Contact", mappedBy="event")
   */
  protected $event_contacts;
  
  /**
   *
   */
  public function __construct() {
      $this-&gt;contacts = new ArrayCollection();
  }
  
  /**
   * Get id
   *
   * @return integer 
   */
  public function getId()
  {
      return $this-&gt;id;
  }
  
  public function getContacts() {
      return $this-&gt;contacts;
  }
  
  public function addContact(Contact $contact) {
      $this-&gt;contacts[] = $contact;
  
      return $this;
  }
  </code></pre>
  
  <p>And have a Contact Entity with ManyToOne Relation</p>
  
  <pre><code>&lt;?php
  
  namespace #\#\#;
  
  use Doctrine\ORM\Mapping as ORM;
  use Turmforum\BookingBundle\Entity\Event;
  
  /**
   * Contact
   *
   * @ORM\Table(name="contacts")
   * @ORM\Entity
   */
  class Contact
  {
  /**
   * @var integer
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  private $id;
  
  /**
   * @ORM\ManyToOne(targetEntity="Event", inversedBy="event_contacts")
   * @ORM\JoinColumn(name="event_id", referencedColumnName="id")
   */
  protected $event;
  
  /**
   * Get id
   *
   * @return integer 
   */
  public function getId()
  {
      return $this-&gt;id;
  }
  
  /**
   * @return mixed
   */
  public function getEvent() {
      return $this-&gt;event;
  }
  </code></pre>
  
  <p>When i try to save my event details over a form i get the error:</p>
  
  <blockquote>
    <p>Neither the property "event_id" nor one of the methods "getEventId()",
    "eventId()", "isEventId()", "hasEventId()", "__get()" exist and have
    public access in class "Turmforum\BookingBundle\Entity\Event".</p>
  </blockquote>
  
  <p>What am i missing?</p>