You are here

interface StockUpdateInterface in Commerce Stock 8

Defines a common interface for writing stock.

Hierarchy

Expanded class hierarchy of StockUpdateInterface

All classes that implement StockUpdateInterface

3 files declare their use of StockUpdateInterface
LocalStockService.php in modules/local_storage/src/LocalStockService.php
LocalStockServiceTest.php in modules/local_storage/tests/src/Kernel/LocalStockServiceTest.php
LocalStockUpdater.php in modules/local_storage/src/LocalStockUpdater.php

File

src/StockUpdateInterface.php, line 10

Namespace

Drupal\commerce_stock
View source
interface StockUpdateInterface {

  /**
   * Create a stock transaction.
   *
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   * @param int $location_id
   *   The location ID.
   * @param string $zone
   *   The zone.
   * @param float $quantity
   *   Tbe quantity.
   * @param float $unit_cost
   *   The unit cost.
   * @param string $currency_code
   *   The currency code.
   * @param int $transaction_type_id
   *   The transaction type ID.
   * @param array $metadata
   *   Holds all the optional values those are:
   *     - related_tid: related transaction.
   *     - related_oid: related order.
   *     - related_uid: related user.
   *     - data: Serialized data array.
   *
   * @return int
   *   Return the ID of the transaction.
   */
  public function createTransaction(PurchasableEntityInterface $entity, $location_id, $zone, $quantity, $unit_cost, $currency_code, $transaction_type_id, array $metadata);

}

Members

Namesort descending Modifiers Type Description Overrides
StockUpdateInterface::createTransaction public function Create a stock transaction. 2