class ProductEvent in Commerce Core 8.2
Defines the product event.
Hierarchy
- class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event
- class \Drupal\commerce_product\Event\ProductEvent
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\EventView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ProductEvent:: |
protected | property | The product. | |
ProductEvent:: |
public | function | Gets the product. | |
ProductEvent:: |
public | function | Constructs a new ProductEvent. |