Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
QueueFactory.php
Go to the documentation of this file.
1 <?php
6 namespace Magento\Deploy\Process;
7 
11 
16 {
22  private $objectManager;
23 
29  private $type;
30 
37  public function __construct(ObjectManagerInterface $objectManager, $type = Queue::class)
38  {
39  $this->objectManager = $objectManager;
40  $this->type = $type;
41  }
42 
50  public function create(array $arguments = [])
51  {
52  $queue = $this->objectManager->create($this->type, $arguments);
53  if (!$queue instanceof Queue) {
54  throw new LocalizedException(
55  new Phrase("Wrong queue type specified.")
56  );
57  }
58  return $queue;
59  }
60 }
$queue
Definition: queue.php:21
$objectManager
Definition: bootstrap.php:17
__construct(ObjectManagerInterface $objectManager, $type=Queue::class)
$arguments