You are here

class SubdivisionsEvent in Address 8

Defines the subdivisions event.

Hierarchy

  • class \Drupal\address\Event\SubdivisionsEvent extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of SubdivisionsEvent

See also

\Drupal\address\Event\AddressEvents

\Drupal\address_test\EventSubscriber\GreatBritainEventSubscriber

\CommerceGuys\Addressing\Subdivision\Subdivision

2 files declare their use of SubdivisionsEvent
GreatBritainEventSubscriber.php in tests/modules/address_test/src/EventSubscriber/GreatBritainEventSubscriber.php
SubdivisionRepository.php in src/Repository/SubdivisionRepository.php

File

src/Event/SubdivisionsEvent.php, line 14

Namespace

Drupal\address\Event
View source
class SubdivisionsEvent extends Event {

  /**
   * The subdivision parents (country code, subdivision codes).
   *
   * @var array
   */
  protected $parents;

  /**
   * The subdivision definitions.
   *
   * @var array
   */
  protected $definitions = [];

  /**
   * Constructs a new SubdivisionsEvent object.
   *
   * @param array $parents
   *   The subdivision parents.
   */
  public function __construct(array $parents) {
    $this->parents = $parents;
  }

  /**
   * Gets the subdivision parents.
   *
   * @return array
   *   The subdivision parents.
   */
  public function getParents() {
    return $this->parents;
  }

  /**
   * Gets the subdivision definitions.
   *
   * @return array
   *   The subdivision definitions.
   */
  public function getDefinitions() {
    return $this->definitions;
  }

  /**
   * Sets the subdivision definitions.
   *
   * @param array $definitions
   *   The subdivision definitions.
   *
   * @return $this
   */
  public function setDefinitions(array $definitions) {
    $this->definitions = $definitions;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SubdivisionsEvent::$definitions protected property The subdivision definitions.
SubdivisionsEvent::$parents protected property The subdivision parents (country code, subdivision codes).
SubdivisionsEvent::getDefinitions public function Gets the subdivision definitions.
SubdivisionsEvent::getParents public function Gets the subdivision parents.
SubdivisionsEvent::setDefinitions public function Sets the subdivision definitions.
SubdivisionsEvent::__construct public function Constructs a new SubdivisionsEvent object.