You are here

protected function SequentialNumberPatternBase::getStoreId in Commerce Core 8.2

Gets the store_id to use for the sequence.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The content entity.

Return value

int The store ID.

2 calls to SequentialNumberPatternBase::getStoreId()
SequentialNumberPatternBase::getInitialSequence in modules/number_pattern/src/Plugin/Commerce/NumberPattern/SequentialNumberPatternBase.php
Gets the initial sequence for the given entity.
SequentialNumberPatternBase::getNextSequence in modules/number_pattern/src/Plugin/Commerce/NumberPattern/SequentialNumberPatternBase.php
Gets the next sequence for the given entity.

File

modules/number_pattern/src/Plugin/Commerce/NumberPattern/SequentialNumberPatternBase.php, line 308

Class

SequentialNumberPatternBase
Provides a base class for number pattern plugins which support sequences.

Namespace

Drupal\commerce_number_pattern\Plugin\Commerce\NumberPattern

Code

protected function getStoreId(ContentEntityInterface $entity) {
  $store_id = 0;
  if (!empty($this->configuration['per_store_sequence']) && $entity instanceof EntityStoreInterface) {
    $store_id = $entity
      ->getStoreId();
  }
  return $store_id;
}