class ProductVariationAjaxChangeEvent in Commerce Core 8.2
Defines the product variation ajax change event.
Hierarchy
- class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event
- class \Drupal\commerce_product\Event\ProductVariationAjaxChangeEvent
 
 
Expanded class hierarchy of ProductVariationAjaxChangeEvent
See also
\Drupal\commerce_product\Event\ProductEvents
1 file declares its use of ProductVariationAjaxChangeEvent
- ProductVariationWidgetBase.php in modules/
product/ src/ Plugin/ Field/ FieldWidget/ ProductVariationWidgetBase.php  
File
- modules/
product/ src/ Event/ ProductVariationAjaxChangeEvent.php, line 14  
Namespace
Drupal\commerce_product\EventView source
class ProductVariationAjaxChangeEvent extends EventBase {
  /**
   * The product variation.
   *
   * @var \Drupal\commerce_product\Entity\ProductVariationInterface
   */
  protected $productVariation;
  /**
   * The ajax response.
   *
   * @var \Drupal\Core\Ajax\AjaxResponse
   */
  protected $response;
  /**
   * The view mode.
   *
   * @var string
   */
  protected $viewMode;
  /**
   * Constructs a new ProductVariationAjaxChangeEvent.
   *
   * @param \Drupal\commerce_product\Entity\ProductVariationInterface $product_variation
   *   The product variation.
   * @param \Drupal\Core\Ajax\AjaxResponse $response
   *   The ajax response.
   * @param string $view_mode
   *   The view mode used to render the product variation.
   */
  public function __construct(ProductVariationInterface $product_variation, AjaxResponse $response, $view_mode = 'default') {
    $this->productVariation = $product_variation;
    $this->response = $response;
    $this->viewMode = $view_mode;
  }
  /**
   * The product variation.
   *
   * @return \Drupal\commerce_product\Entity\ProductVariationInterface
   *   The product variation.
   */
  public function getProductVariation() {
    return $this->productVariation;
  }
  /**
   * The ajax response.
   *
   * @return \Drupal\Core\Ajax\AjaxResponse
   *   The ajax reponse.
   */
  public function getResponse() {
    return $this->response;
  }
  /**
   * The view mode used to render the product variation.
   *
   * @return string
   *   The view mode.
   */
  public function getViewMode() {
    return $this->viewMode;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            ProductVariationAjaxChangeEvent:: | 
                  protected | property | The product variation. | |
| 
            ProductVariationAjaxChangeEvent:: | 
                  protected | property | The ajax response. | |
| 
            ProductVariationAjaxChangeEvent:: | 
                  protected | property | The view mode. | |
| 
            ProductVariationAjaxChangeEvent:: | 
                  public | function | The product variation. | |
| 
            ProductVariationAjaxChangeEvent:: | 
                  public | function | The ajax response. | |
| 
            ProductVariationAjaxChangeEvent:: | 
                  public | function | The view mode used to render the product variation. | |
| 
            ProductVariationAjaxChangeEvent:: | 
                  public | function | Constructs a new ProductVariationAjaxChangeEvent. |