Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractPaymentTokenFactory.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Vault\Model;
7 
12 
19 {
23  private $objectManager;
24 
28  private $paymentTokenFactory;
29 
35  public function __construct(
36  ObjectManagerInterface $objectManager,
37  PaymentTokenFactoryInterface $paymentTokenFactory = null
38  ) {
39  if ($paymentTokenFactory === null) {
40  $paymentTokenFactory = $objectManager->get(PaymentTokenFactoryInterface::class);
41  }
42 
43  $this->objectManager = $objectManager;
44  $this->paymentTokenFactory = $paymentTokenFactory;
45  }
46 
51  public function create()
52  {
53  return $this->paymentTokenFactory->create($this->getType());
54  }
55 }
__construct(ObjectManagerInterface $objectManager, PaymentTokenFactoryInterface $paymentTokenFactory=null)
$objectManager
Definition: bootstrap.php:17