/**
  * {@inheritDoc}
  */
 public function injectFile($obj, PropertyMapping $mapping)
 {
     $path = $this->storage->resolvePath($obj, $mapping->getFilePropertyName());
     if ($path !== null) {
         $mapping->setFile($obj, new File($path, false));
     }
 }
예제 #2
0
 public function testPropertiesAreSet()
 {
     $date = new \DateTime();
     $object = new DummyEntity();
     $prop = new PropertyMapping('file', 'fileName');
     $prop->setFile($object, $date);
     $prop->setFileName($object, 'joe.png');
     $this->assertSame($date, $object->getFile());
     $this->assertSame('joe.png', $object->getFileName());
 }