title: how to get the type of a doctrine entity property
body: <p>Actually I have a doctrine entity that I need to fill its prperties dynamically.</p>
  
  <p>I'd like to be able to do something like this:</p>
  
  <pre><code>$entity = new Entity();
  $reflect = new ReflectionClass($entity);
  // $fields is an array whihch contain the entity name as the array key and the value as the array value
  foreach ($fields as $key =&gt; $val)
  {
      if (!reflect-&gt;hasProperty($key)) {
          var_dump('the entity does not have a such property');
          continue;
      }
      if ( the type of $key is string ) {
            // convert $value to utf8
      } elseif ( the type of $key is integer) {
            // do something else
      } //....etc
  }
  </code></pre>
  
  <p>How do I do this?</p>