You are here

class SetHashCommand in Feeds 8.3

Defines an AJAX command to set the window.hash.

Hierarchy

Expanded class hierarchy of SetHashCommand

1 file declares its use of SetHashCommand
FeedTypeForm.php in src/FeedTypeForm.php

File

src/Ajax/SetHashCommand.php, line 10

Namespace

Drupal\feeds\Ajax
View source
class SetHashCommand implements CommandInterface {

  /**
   * The hash into window.hash.
   *
   * @var string
   */
  protected $hash;

  /**
   * Constructs a SetHashCommand object.
   *
   * @param string $hash
   *   The hash that will be loaded into window.hash.
   */
  public function __construct($hash) {
    $this->hash = $hash;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return [
      'command' => 'feedsHash',
      'hash' => $this->hash,
    ];
  }

}

Members

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