class ActionUploadRemoveFile in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2
Action for processing removing file from a upload list.
Hierarchy
- class \Drupal\n1ed\Flmngr\FileUploaderServer\lib\action\AAction
- class \Drupal\n1ed\Flmngr\FileUploaderServer\lib\action\AActionUploadId
- class \Drupal\n1ed\Flmngr\FileUploaderServer\lib\action\ActionUploadRemoveFile
- class \Drupal\n1ed\Flmngr\FileUploaderServer\lib\action\AActionUploadId
Expanded class hierarchy of ActionUploadRemoveFile
1 file declares its use of ActionUploadRemoveFile
- Actions.php in src/
Flmngr/ FileUploaderServer/ lib/ Actions.php
File
- src/
Flmngr/ FileUploaderServer/ lib/ action/ ActionUploadRemoveFile.php, line 13
Namespace
Drupal\n1ed\Flmngr\FileUploaderServer\lib\actionView source
class ActionUploadRemoveFile extends AActionUploadId {
/**
* {@inheritdoc}
*/
public function getName() {
return "uploadRemoveFile";
}
/**
* {@inheritdoc}
*/
public function run($req) {
$this
->validateUploadId($req);
$file = new FileUploaded($this->config, $req->uploadId, $req->name, $req->name);
$file
->checkForErrors(TRUE);
if ($file
->getErrors()
->size() > 0) {
throw new MessageException(Message::createMessageByFile(Message::UNABLE_TO_DELETE_UPLOAD_DIR, $file
->getData()));
}
$file
->delete();
return new RespOk();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AAction:: |
protected | property | ||
AAction:: |
public | function | Sets a config. | |
AAction:: |
protected | function | Validates boolean and returns default value if null. | |
AAction:: |
protected | function | Validates integer and returns default value if null. | |
AAction:: |
protected | function | Validates string and returns default value if null. | |
AActionUploadId:: |
protected | function | Validates upload ID and throws exception in case of validation error. | |
ActionUploadRemoveFile:: |
public | function |
Returnes name of action. Overrides AAction:: |
|
ActionUploadRemoveFile:: |
public | function |
Runs action. Overrides AAction:: |