You are here

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

Actions list. This class helps to understand which type of request Uploader received by checking all available handlers' names.

Hierarchy

  • class \Drupal\n1ed\Flmngr\FileUploaderServer\lib\Actions

Expanded class hierarchy of Actions

1 file declares its use of Actions
UploaderServlet.php in src/Flmngr/FileUploaderServer/servlet/UploaderServlet.php

File

src/Flmngr/FileUploaderServer/lib/Actions.php, line 18

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib
View source
class Actions {
  protected $actions = [];

  /**
   * Creates the list.
   */
  public function __construct() {
    $this->actions[] = new ActionError();
    $this->actions[] = new ActionUploadInit();
    $this->actions[] = new ActionUploadAddFile();
    $this->actions[] = new ActionUploadRemoveFile();
    $this->actions[] = new ActionUploadCommit();
    $this->actions[] = new ActionUploadCancel();
    $this->actions[] = new ActionQuickUpload();
  }

  /**
   * Gets action for error.
   */
  public function getActionError() {
    return $this
      ->getAction('error');
  }

  /**
   * Gets action by name.
   */
  public function getAction($name) {
    for ($i = 0; $i < count($this->actions); $i++) {
      if ($this->actions[$i]
        ->getName() === $name) {
        return $this->actions[$i];
      }
    }
    return null;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Actions::$actions protected property
Actions::getAction public function Gets action by name.
Actions::getActionError public function Gets action for error.
Actions::__construct public function Creates the list.