0 follower

Final Class Yiisoft\Queue\Provider\CompositeQueueProvider

InheritanceYiisoft\Queue\Provider\CompositeQueueProvider
ImplementsYiisoft\Queue\Provider\QueueProviderInterface

Composite queue provider.

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Queue\Provider\QueueProviderInterface $providers )
$providers Yiisoft\Queue\Provider\QueueProviderInterface

Queue providers to use.

                public function __construct(
    QueueProviderInterface ...$providers,
) {
    $this->providers = $providers;
}

            
get() public method

public Yiisoft\Queue\QueueInterface get ( string|\BackedEnum $name )
$name string|\BackedEnum

                public function get(string|BackedEnum $name): QueueInterface
{
    foreach ($this->providers as $provider) {
        if ($provider->has($name)) {
            return $provider->get($name);
        }
    }
    throw new QueueNotFoundException($name);
}

            
getNames() public method

public array getNames ( )

                public function getNames(): array
{
    $names = [];
    foreach ($this->providers as $provider) {
        $names[] = $provider->getNames();
    }
    return array_values(array_unique(array_merge(...$names)));
}

            
has() public method

public boolean has ( string|\BackedEnum $name )
$name string|\BackedEnum

                public function has(string|BackedEnum $name): bool
{
    foreach ($this->providers as $provider) {
        if ($provider->has($name)) {
            return true;
        }
    }
    return false;
}