Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
QuoteIdMask.php
Go to the documentation of this file.
1 <?php
7 namespace Magento\Quote\Model;
8 
16 {
21 
30  public function __construct(
31  \Magento\Framework\Model\Context $context,
32  \Magento\Framework\Registry $registry,
33  \Magento\Framework\Math\Random $randomDataGenerator,
34  \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
35  \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
36  array $data = []
37  ) {
38  $this->randomDataGenerator = $randomDataGenerator;
39  parent::__construct($context, $registry, $resource, $resourceCollection, $data);
40  }
41 
47  protected function _construct()
48  {
49  $this->_init(\Magento\Quote\Model\ResourceModel\Quote\QuoteIdMask::class);
50  }
51 
57  public function beforeSave()
58  {
59  parent::beforeSave();
60  $this->setMaskedId($this->randomDataGenerator->getUniqueHash());
61  return $this;
62  }
63 }
__construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Math\Random $randomDataGenerator, \Magento\Framework\Model\ResourceModel\AbstractResource $resource=null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection=null, array $data=[])
Definition: QuoteIdMask.php:30
$resource
Definition: bulk.php:12