You are here

abstract class AActionUploadId in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Abstract class for all upload actions.

Hierarchy

  • class \Drupal\n1ed\Flmngr\FileUploaderServer\lib\action\AAction

Expanded class hierarchy of AActionUploadId

File

src/Flmngr/FileUploaderServer/lib/action/AActionUploadId.php, line 11

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib\action
View source
abstract class AActionUploadId extends AAction {

  /**
   * Validates upload ID and throws exception in case of validation error.
   */
  protected function validateUploadId($req) {
    if ($req->uploadId === NULL) {
      throw new MessageException(Message::createMessage(Message::UPLOAD_ID_NOT_SET));
    }
    $dir = $this->config
      ->getTmpDir() . DIRECTORY_SEPARATOR . $req->uploadId;
    if (!file_exists($dir) || !is_dir($dir)) {
      throw new MessageException(Message::createMessage(Message::UPLOAD_ID_INCORRECT));
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AAction::$config protected property
AAction::getName abstract public function Returnes name of action. 7
AAction::run abstract public function Runs action. 7
AAction::setConfig public function Sets a config.
AAction::validateBoolean protected function Validates boolean and returns default value if null.
AAction::validateInteger protected function Validates integer and returns default value if null.
AAction::validateString protected function Validates string and returns default value if null.
AActionUploadId::validateUploadId protected function Validates upload ID and throws exception in case of validation error.