You are here

interface StockLocationStorageInterface in Commerce Stock 8

Defines the interface for local stock location storage.

Hierarchy

Expanded class hierarchy of StockLocationStorageInterface

All classes that implement StockLocationStorageInterface

File

modules/local_storage/src/StockLocationStorageInterface.php, line 12

Namespace

Drupal\commerce_stock_local
View source
interface StockLocationStorageInterface extends SqlEntityStorageInterface {

  /**
   * Loads the enabled locations for the given Purchasable Entity.
   *
   * Enabled variations are active stock locations that have
   * been filtered through the FILTER_STOCK_LOCATIONS event.
   *
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   *
   * @return \Drupal\commerce_stock_local\Entity\StockLocation[]
   *   The enabled stock locations.
   */
  public function loadEnabled(PurchasableEntityInterface $entity);

  /**
   * Loads the relevant locations for the given Purchasable Entity and context.
   *
   * Relevant locations are active and available for fulfillment for the product
   * and context provided.
   *
   * @param \Drupal\commerce\Context $context
   *   The context.
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   *
   * @return \Drupal\commerce_stock_local\Entity\StockLocation[]
   *   The enabled stock locations.
   */
  public function loadInContext(Context $context, PurchasableEntityInterface $entity);

  /**
   * Get the transaction location for the given product and context.
   *
   * @param \Drupal\commerce\Context $context
   *   The context.
   * @param \Drupal\commerce\PurchasableEntityInterface $entity
   *   The purchasable entity.
   *
   * @return \Drupal\commerce_stock_local\Entity\StockLocation[]
   *   The enabled stock locations.
   */
  public function getTransactionLocation(Context $context, PurchasableEntityInterface $entity);

}

Members

Namesort descending Modifiers Type Description Overrides
EntityStorageInterface::create public function Constructs a new entity object, without permanently saving it. 1
EntityStorageInterface::delete public function Deletes permanently saved entities. 1
EntityStorageInterface::deleteRevision public function Delete a specific entity revision. 4
EntityStorageInterface::FIELD_LOAD_CURRENT constant Load the most recent version of an entity's field data.
EntityStorageInterface::FIELD_LOAD_REVISION constant Load the version of an entity's field data specified in the entity.
EntityStorageInterface::getAggregateQuery public function Gets an aggregated query instance. 1
EntityStorageInterface::getEntityType public function Gets the entity type definition. 1
EntityStorageInterface::getEntityTypeId public function Gets the entity type ID. 1
EntityStorageInterface::getQuery public function Gets an entity query instance. 1
EntityStorageInterface::hasData public function Determines if the storage contains any data. 1
EntityStorageInterface::load public function Loads one entity. 1
EntityStorageInterface::loadByProperties public function Load entities by their property values. 1
EntityStorageInterface::loadMultiple public function Loads one or more entities. 1
EntityStorageInterface::loadRevision public function Load a specific entity revision. 4
EntityStorageInterface::loadUnchanged public function Loads an unchanged entity from the database. 1
EntityStorageInterface::resetCache public function Resets the internal, static entity cache. 1
EntityStorageInterface::restore public function Restores a previously saved entity. 1
EntityStorageInterface::save public function Saves the entity permanently. 1
SqlEntityStorageInterface::getTableMapping public function Gets a table mapping for the entity's SQL tables. 1
StockLocationStorageInterface::getTransactionLocation public function Get the transaction location for the given product and context. 1
StockLocationStorageInterface::loadEnabled public function Loads the enabled locations for the given Purchasable Entity. 1
StockLocationStorageInterface::loadInContext public function Loads the relevant locations for the given Purchasable Entity and context. 1