You are here

public function QueueUIManager::fromQueueName in Queue UI 8.2

Parameters

$queue_name:

Return value

bool|object

File

src/QueueUIManager.php, line 42

Class

QueueUIManager
Defines the queue worker manager.

Namespace

Drupal\queue_ui

Code

public function fromQueueName($queue_name) {
  $queue = \Drupal::queue($queue_name);
  try {
    foreach ($this
      ->getDefinitions() as $definition) {
      if ($definition['class_name'] == $this
        ->queueClassName($queue)) {
        return parent::createInstance($definition['id']);
      }
    }
  } catch (\Exception $e) {
  }
  return FALSE;
}