$this->uploads = [];
foreach (\array_keys($this->getUploadFields()) as $field) {
- $removedFiles = UploadHandler::getInstance()->getRemovedFiledByFieldId($field);
+ $removedFiles = UploadHandler::getInstance()->getRemovedFilesByFieldId($field);
if (!empty($removedFiles)) {
$this->uploads[$field] = null;
}
}
$this->customAssets = [
- 'removed' => UploadHandler::getInstance()->getRemovedFiledByFieldId('customAssets'),
+ 'removed' => UploadHandler::getInstance()->getRemovedFilesByFieldId('customAssets'),
'added' => UploadHandler::getInstance()->getFilesByFieldId('customAssets'),
];
}
$this->hideTitle = \intval($_POST['hideTitle']);
}
- $this->removedRankImages = UploadHandler::getInstance()->getRemovedFiledByFieldId('rankImage');
+ $this->removedRankImages = UploadHandler::getInstance()->getRemovedFilesByFieldId('rankImage');
$rankImageFiles = UploadHandler::getInstance()->getFilesByFieldId('rankImage');
$this->rankImageFile = \reset($rankImageFiles);
}
*
* @throws \InvalidArgumentException if the given fieldId is unknown
*/
- public function getRemovedFiledByFieldId($fieldId, $processFiles = true)
+ public function getRemovedFilesByFieldId($fieldId, $processFiles = true)
{
if (!isset($this->fields[$fieldId])) {
throw new \InvalidArgumentException('UploadField with the id "' . $fieldId . '" is unknown.');
}
- return $this->getRemovedFiledByInternalId($this->fields[$fieldId]->getInternalId(), $processFiles);
+ return $this->getRemovedFilesByInternalId($this->fields[$fieldId]->getInternalId(), $processFiles);
+ }
+
+ /**
+ * @deprecated 6.0 This method exists only because of a spelling error in the method name. Use `getRemovedFiledByFieldId` instead.
+ */
+ public function getRemovedFiledByFieldId($fieldId, $processFiles = true)
+ {
+ return $this->getRemovedFilesByFieldId($fieldId, $processFiles);
}
/**
* @param bool $processFiles
* @return UploadFile[]
*/
- public function getRemovedFiledByInternalId($internalId, $processFiles = true)
+ public function getRemovedFilesByInternalId($internalId, $processFiles = true)
{
if (isset($this->getStorage()[$internalId])) {
$files = $this->getStorage()[$internalId]['removedFiles'];
return [];
}
+ /**
+ * @deprecated 6.0 This method exists only because of a spelling error in the method name. Use `getRemovedFilesByInternalId` instead.
+ */
+ public function getRemovedFiledByInternalId($internalId, $processFiles = true)
+ {
+ return $this->getRemovedFilesByInternalId($internalId, $processFiles);
+ }
+
/**
* Removes a file from the upload.
*