src/app/n2n/impl/persistence/orm/property/FileProperty.php
public function supplyPersistAction($mappedValue, PersistAction $persistingJob) {
		$columnName = $this->getColumnName();

		$fileManager = $this->getFileManager();
		$fileLocator = $this->fileLocator;
		
		$that = $this;
		$persistingJob->executeAtStart(function(PersistAction $persistingJob) use ($that, $fileManager, $fileLocator, $mappedValue, $columnName) {
			$oldDataSet = $persistingJob->getOldRawDataMap();
			
			$oldQualifiedName = null;
			if (isset($oldDataSet)) {
				$oldQualifiedName = $oldDataSet->offsetGet($columnName);
			}
			
			if (isset($oldQualifiedName) && isset($mappedValue) && $mappedValue->isManaged() 
					&& $fileManager->equals($mappedValue->getFileManager())
					&& $oldQualifiedName === $mappedValue->getQualifiedName()) {
				$persistingJob->getMeta()->setRawValue($that->getEntityModel(), $that->getColumnName(), $oldQualifiedName);
				return;
			}
			
			if (isset($oldQualifiedName)) {
				$oldFile = $fileManager->getByQualifiedName($oldQualifiedName);
				if (isset($oldFile)) $oldFile->moveToTmp();
			}
			
			if (isset($mappedValue)) {
				$persistingJob->getMeta()->setRawValue($that->getEntityModel(), $columnName, 
						$fileManager->persist($mappedValue, $fileLocator));
				return;
			}
			
			$persistingJob->getMeta()->setRawValue($that->getEntityModel(), $columnName, null);
		});
	}
public function supplyPersistAction($mappedValue, PersistAction $persistingJob) {
		$columnName = $this->getColumnName();

		$fileManager = $this->getFileManager();
		$fileLocator = $this->fileLocator;
		
		$that = $this;
		$persistingJob->executeAtStart(function(PersistAction $persistingJob) use ($that, $fileManager, $fileLocator, $mappedValue, $columnName) {
			$oldDataSet = $persistingJob->getOldRawDataMap();
			
			$oldQualifiedName = null;
			if (isset($oldDataSet)) {
				$oldQualifiedName = $oldDataSet->offsetGet($columnName);
			}
			
			if (isset($oldQualifiedName) && isset($mappedValue) && $mappedValue->isManaged() 
					&& $fileManager->equals($mappedValue->getFileManager())
					&& $oldQualifiedName === $mappedValue->getQualifiedName()) {
				$persistingJob->getMeta()->setRawValue($that->getEntityModel(), $that->getColumnName(), $oldQualifiedName);
				return;
			}
			
			if (isset($oldQualifiedName)) {
				$oldFile = $fileManager->getByQualifiedName($oldQualifiedName);
				if (isset($oldFile)) $oldFile->moveToTmp();
			}
			
			if (isset($mappedValue)) {
				$persistingJob->getMeta()->setRawValue($that->getEntityModel(), $columnName, 
						$fileManager->persist($mappedValue, $fileLocator));
				return;
			}
			
			$persistingJob->getMeta()->setRawValue($that->getEntityModel(), $columnName, null);
		});
	}
}