You are here

class FilterLocationsEvent in Commerce Stock 8

Defines the filter locations event.

Hierarchy

  • class \Drupal\commerce_stock_local\Event\FilterLocationsEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of FilterLocationsEvent

See also

\Drupal\commerce_stock_local\Event\LocalStockEvents

1 file declares its use of FilterLocationsEvent
StockLocationStorage.php in modules/local_storage/src/StockLocationStorage.php

File

modules/local_storage/src/Event/FilterLocationsEvent.php, line 13

Namespace

Drupal\commerce_stock_local\Event
View source
class FilterLocationsEvent extends Event {

  /**
   * The purchasable entity.
   *
   * @var \Drupal\commerce\PurchasableEntityInterface
   */
  protected $purchasableEntity;

  /**
   * The enabled stock locations.
   *
   * @var \Drupal\commerce_stock_local\Entity\LocalStockLocationInterface
   *   The local stock locations.
   */
  protected $locations;

  /**
   * Constructs a new FilterLocationsEvent object.
   *
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   * @param \Drupal\commerce_stock_local\Entity\LocalStockLocationInterface[] $locations
   *   The local stock locations.
   */
  public function __construct(PurchasableEntityInterface $entity, array $locations) {
    $this->purchasableEntity = $entity;
    $this->locations = $locations;
  }

  /**
   * Gets the enabled stock locations.
   *
   * @return \Drupal\commerce_stock_local\Entity\LocalStockLocationInterface[]
   *   Array of local stock locations.
   */
  public function getLocations() {
    return $this->locations;
  }

  /**
   * Sets the enabled stock locations.
   *
   * @param \Drupal\commerce_stock_local\Entity\LocalStockLocationInterface[] $locations
   *   The stock locations.
   */
  public function setLocations(array $locations) {
    $this->locations = $locations;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FilterLocationsEvent::$locations protected property The enabled stock locations.
FilterLocationsEvent::$purchasableEntity protected property The purchasable entity.
FilterLocationsEvent::getLocations public function Gets the enabled stock locations.
FilterLocationsEvent::setLocations public function Sets the enabled stock locations.
FilterLocationsEvent::__construct public function Constructs a new FilterLocationsEvent object.