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
7 
14 class Increment extends \Magento\Eav\Model\Entity\Attribute\Backend\AbstractBackend
15 {
22  public function beforeSave($object)
23  {
24  if (!$object->getId()) {
25  $this->getAttribute()->getEntity()->setNewIncrementId($object);
26  }
27 
28  return $this;
29  }
30 }