You are here

class ProductEvent in Commerce Core 8.2

Defines the product event.

Hierarchy

  • class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of ProductEvent

See also

\Drupal\commerce_product\Event\ProductEvents

File

modules/product/src/Event/ProductEvent.php, line 13

Namespace

Drupal\commerce_product\Event
View source
class ProductEvent extends EventBase {

  /**
   * The product.
   *
   * @var \Drupal\commerce_product\Entity\ProductInterface
   */
  protected $product;

  /**
   * Constructs a new ProductEvent.
   *
   * @param \Drupal\commerce_product\Entity\ProductInterface $product
   *   The product.
   */
  public function __construct(ProductInterface $product) {
    $this->product = $product;
  }

  /**
   * Gets the product.
   *
   * @return \Drupal\commerce_product\Entity\ProductInterface
   *   The product.
   */
  public function getProduct() {
    return $this->product;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ProductEvent::$product protected property The product.
ProductEvent::getProduct public function Gets the product.
ProductEvent::__construct public function Constructs a new ProductEvent.