You are here

class CommandWrapper in Ubercart 8.4

AJAX command wrapper for commands that have already been rendered.

Hierarchy

Expanded class hierarchy of CommandWrapper

1 file declares its use of CommandWrapper
AjaxAttachTrait.php in uc_store/src/AjaxAttachTrait.php

File

uc_store/src/Ajax/CommandWrapper.php, line 10

Namespace

Drupal\uc_store\Ajax
View source
class CommandWrapper implements CommandInterface {

  /**
   * The command.
   *
   * @var array
   */
  protected $command;

  /**
   * Constructs an CommandWrapper object.
   *
   * @param array $command
   *   The command.
   */
  public function __construct(array $command) {
    $this->command = $command;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return $this->command;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CommandWrapper::$command protected property The command.
CommandWrapper::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
CommandWrapper::__construct public function Constructs an CommandWrapper object.