Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Increment.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Sales\Model;
7 
8 use Magento\Eav\Model\Config as EavConfig;
9 
14 class Increment
15 {
19  protected $eavConfig;
20 
24  protected $incrementValue;
25 
29  public function __construct(
30  EavConfig $eavConfig
31  ) {
32  $this->eavConfig = $eavConfig;
33  }
34 
40  public function getCurrentValue()
41  {
42  return $this->incrementValue;
43  }
44 
53  public function getNextValue($storeId)
54  {
55  $this->incrementValue =
56  $this->eavConfig->getEntityType(Order::ENTITY)->fetchNewIncrementId($storeId);
57  return $this->incrementValue;
58  }
59 }
__construct(EavConfig $eavConfig)
Definition: Increment.php:29