You are here

final class ShippingService in Commerce Shipping 8.2

Represents a shipping service.

Hierarchy

Expanded class hierarchy of ShippingService

5 files declare their use of ShippingService
FlatRate.php in src/Plugin/Commerce/ShippingMethod/FlatRate.php
PromotionSubscriberTest.php in tests/src/Kernel/EventSubscriber/PromotionSubscriberTest.php
ShippingMethodBase.php in src/Plugin/Commerce/ShippingMethod/ShippingMethodBase.php
ShippingRateTest.php in tests/src/Unit/ShippingRateTest.php
ShippingServiceTest.php in tests/src/Unit/ShippingServiceTest.php

File

src/ShippingService.php, line 8

Namespace

Drupal\commerce_shipping
View source
final class ShippingService {

  /**
   * The shipping service ID.
   *
   * @var string
   */
  protected $id;

  /**
   * The shipping service label.
   *
   * @var string
   */
  protected $label;

  /**
   * Constructs a new ShippingService instance.
   *
   * @param string $id
   *   The shipping service ID.
   * @param string $label
   *   The shipping service label.
   */
  public function __construct($id, $label) {
    $this->id = $id;
    $this->label = $label;
  }

  /**
   * Gets the shipping service ID.
   *
   * @return string
   *   The shipping service ID.
   */
  public function getId() : string {
    return $this->id;
  }

  /**
   * Gets the shipping service label.
   *
   * @return string
   *   The shipping service label.
   */
  public function getLabel() : string {
    return $this->label;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ShippingService::$id protected property The shipping service ID.
ShippingService::$label protected property The shipping service label.
ShippingService::getId public function Gets the shipping service ID.
ShippingService::getLabel public function Gets the shipping service label.
ShippingService::__construct public function Constructs a new ShippingService instance.