You are here

class ResponseEvent in Build Hooks 3.x

Same name and namespace in other branches
  1. 8.2 src/Event/ResponseEvent.php \Drupal\build_hooks\Event\ResponseEvent

Class ResponseEvent. Event fired when a build event gets the response.

@package Drupal\build_hooks\Event

Hierarchy

  • class \Drupal\build_hooks\Event\ResponseEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of ResponseEvent

1 file declares its use of ResponseEvent
Trigger.php in src/Trigger.php

File

src/Event/ResponseEvent.php, line 14

Namespace

Drupal\build_hooks\Event
View source
class ResponseEvent extends Event {
  const EVENT_NAME = 'build_hooks.response';

  /**
   * The http client response.
   *
   * @var \Psr\Http\Message\ResponseInterface
   */
  protected $response;

  /**
   * The build hook plugin.
   *
   * @var \Drupal\build_hooks\Plugin\FrontendEnvironmentInterface
   */
  protected $plugin;

  /**
   * Set the response.
   *
   * @param \Psr\Http\Message\ResponseInterface $response
   *   Response.
   */
  public function setResponse(ResponseInterface $response) {
    $this->response = $response;
  }

  /**
   * Get the response.
   *
   * @return \Psr\Http\Message\ResponseInterface
   *   The http client $response.
   */
  public function getResponse() {
    return $this->response;
  }

  /**
   * Set the plugin.
   *
   * @param \Drupal\build_hooks\Plugin\FrontendEnvironmentInterface $plugin
   *   The build hook plugin.
   */
  public function setPlugin(FrontendEnvironmentInterface $plugin) {
    $this->plugin = $plugin;
  }

  /**
   * Get the plugin.
   *
   * @return \Drupal\build_hooks\Plugin\FrontendEnvironmentInterface
   *   The build hook plugin.
   */
  public function getPlugin() {
    return $this->plugin;
  }

  /**
   * ResponseEvent constructor.
   *
   * @param \Psr\Http\Message\ResponseInterface $response
   *   The http client $response.
   * @param \Drupal\build_hooks\Plugin\FrontendEnvironmentInterface $plugin
   *   The build hook plugin.
   */
  public function __construct(ResponseInterface $response, FrontendEnvironmentInterface $plugin) {
    $this->response = $response;
    $this->plugin = $plugin;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ResponseEvent::$plugin protected property The build hook plugin.
ResponseEvent::$response protected property The http client response.
ResponseEvent::EVENT_NAME constant
ResponseEvent::getPlugin public function Get the plugin.
ResponseEvent::getResponse public function Get the response.
ResponseEvent::setPlugin public function Set the plugin.
ResponseEvent::setResponse public function Set the response.
ResponseEvent::__construct public function ResponseEvent constructor.