class BaseCommand

Base AJAX command that only exists simplify Edit's actual AJAX commands.

Hierarchy

Expanded class hierarchy of BaseCommand

1 file declares its use of BaseCommand

File

drupal/core/modules/edit/lib/Drupal/edit/Ajax/BaseCommand.php, line 15
Contains \Drupal\edit\Ajax\BaseCommand.

Namespace

Drupal\edit\Ajax
View source
class BaseCommand implements CommandInterface {

  /**
   * The name of the command.
   *
   * @var string
   */
  protected $command;

  /**
   * The data to pass on to the client side.
   *
   * @var string
   */
  protected $data;

  /**
   * Constructs a BaseCommand object.
   *
   * @param string $data
   *   The data to pass on to the client side.
   */
  public function __construct($command, $data) {
    $this->command = $command;
    $this->data = $data;
  }

  /**
   * Implements Drupal\Core\Ajax\CommandInterface:render().
   */
  public function render() {
    return array(
      'command' => $this->command,
      'data' => $this->data,
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BaseCommand::$command protected property The name of the command.
BaseCommand::$data protected property The data to pass on to the client side.
BaseCommand::render public function Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface::render
BaseCommand::__construct public function Constructs a BaseCommand object. 4