title: How do I add extra data to a submitted form in Symfony 2?
body: <p>I have a simple form that only uploads an image. However, in my database I want to extract and record some EXIF data from that image. </p>
  
  <p>I'm not sure what to use in Symfony2. It does't seem like the right place to calculate this extra information in the Entity. Where else could I put it?</p>
  
  <pre><code>&lt;?php
  
  namespace Timeline\DefaultBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  use Symfony\Component\HttpFoundation\File\UploadedFile;
  
  /**
   * @ORM\Entity
   * @ORM\HasLifecycleCallbacks
   */
  class Document
  {
      //...
  
      /**
       * @ORM\PrePersist()
       * @ORM\PreUpdate()
       */
      public function preUpload()
      {
          // extract EXIF here?
      }
  
  }
  </code></pre>