/**
  * Creates the property mapping from the read annotation and configured mapping.
  *
  * @param  object $obj The object.
  * @param  \ReflectionClass $class
  * @param  \Iphp\FileStoreBundle\Mapping\Annotation\UploadableField $field The read annotation.
  * @return \Iphp\FileStoreBundle\Mapping\PropertyMapping     The property mapping.
  * @throws \InvalidArgumentException
  */
 protected function createMapping($obj, \ReflectionClass $class, UploadableField $field)
 {
     if (!array_key_exists($field->getMapping(), $this->mappingsConfig)) {
         throw new \InvalidArgumentException(sprintf('No mapping named "%s" configured.', $field->getMapping()));
     }
     $config = $this->mappingsConfig[$field->getMapping()];
     $mapping = new PropertyMapping($obj, $config, $this->namerServiceInvoker);
     $mapping->setFileUploadProperty($class->getProperty($field->getFileUploadPropertyName()));
     $mapping->setFileDataProperty($class->getProperty($field->getFileDataPropertyName()));
     $mapping->setMappingName($field->getMapping());
     return $mapping;
 }