title: How persist new Entity in Doctrine 2 prePersist method?
body: <p>I've a Entity with @HasLifecycleCallbacks for define prePersist and preUpdate method.</p>
  
  <p>My PrePersist method is</p>
  
  <pre><code>/**
   * @ORM\OneToMany(targetEntity="Field", mappedBy="service", cascade={"persist"}, orphanRemoval=true)
   */
  protected $fields;
  
  /**
   * @PrePersist()
   */
  public function populate() {
      $fieldsCollection = new \Doctrine\Common\Collections\ArrayCollection();
  
      $fields = array();
      preg_match_all('/%[a-z]+%/', $this-&gt;getPattern(), $fields);
      if (isset($fields[0])) {
          foreach ($fields[0] as $field_name) {
              $field = new Field();
              $field-&gt;setField($field_name);
              $field-&gt;setService($this);
              $fieldsCollection-&gt;add($field);
          }
          $this-&gt;setFields($fieldsCollection);
      }
  }
  </code></pre>
  
  <p>I hoped that this could persist my Field entities, but my table is empty.
  Should I use an EntityManager? How can I retrieve it within my Entity?</p>