public function deleteFieldData(VersionInfo $versionInfo, array $fieldIds, array $context)
{
if (empty($fieldIds)) {
return;
}
$gateway = $this->getGateway($context);
$referencedFiles = $gateway->getReferencedFiles($fieldIds, $versionInfo->versionNo);
$gateway->removeFileReferences($fieldIds, $versionInfo->versionNo);
$referenceCountMap = $gateway->countFileReferences($referencedFiles);
foreach ($referenceCountMap as $filePath => $count) {
if ($count === 0) {
$binaryFile = $this->IOService->loadBinaryFile($filePath);
$this->IOService->deleteBinaryFile($binaryFile);
}
}
}