Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RetryButton.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  private $details;
19 
23  private $request;
24 
28  private $targetName;
29 
37  public function __construct(
38  \Magento\AsynchronousOperations\Model\Operation\Details $details,
39  \Magento\Framework\App\RequestInterface $request,
40  $targetName = 'bulk_details_form.bulk_details_form'
41  ) {
42  $this->details = $details;
43  $this->request = $request;
44  $this->targetName = $targetName;
45  }
46 
50  public function getButtonData()
51  {
52  $uuid = $this->request->getParam('uuid');
53  $details = $this->details->getDetails($uuid);
54  if ($details['failed_retriable'] === 0) {
55  return [];
56  }
57  return [
58  'label' => __('Retry'),
59  'class' => 'retry primary',
60  'data_attribute' => [
61  'mage-init' => ['button' => ['event' => 'save']],
62  'form-role' => 'save',
63  ],
64  ];
65  }
66 }
$details
Definition: vault.phtml:10
__()
Definition: __.php:13
__construct(\Magento\AsynchronousOperations\Model\Operation\Details $details, \Magento\Framework\App\RequestInterface $request, $targetName='bulk_details_form.bulk_details_form')
Definition: RetryButton.php:37