title: Doctrine 2 write to BLOB type
body: <p>I am in need to write to BLOB column with doctrine 2. As documentation suggests BLOB type maps to PHP resource. So I tried fwrite() and it doesn't work.</p>
  
  <pre><code>/**
   * @Entity @Table(name="products")
   **/
  class Product
  {
      /** @Id @Column(type="integer") @GeneratedValue **/
      protected $id;
  
      /** @Column(type="blob") **/
      protected $fileResource;
  
      public function getFileResource() {
         return $this-&gt;fileResource;
      }
  
      // .. (other code)
  }
  </code></pre>
  
  <p>My test case (couldn't find a official example): </p>
  
  <pre><code>$product = new Product();
  fwrite($product-&gt;getFileResource(), "The Data");
  $em-&gt;persist($product);
  $em-&gt;flush();
  </code></pre>
  
  <p>What is my mistake?</p>