setQueue() public méthode

Sets the queue.
public setQueue ( MultipleQueue $queue ) : void
$queue UrbanIndo\Yii2\Queue\Queues\MultipleQueue The queue.
Résultat void
 /**
  * Initialize the queue.
  */
 public function init()
 {
     parent::init();
     $queueObjects = [];
     foreach ($this->queues as $id => $queue) {
         $queueObjects[$id] = \Yii::createObject($queue);
     }
     $this->queues = $queueObjects;
     if (!isset($this->strategy)) {
         $this->strategy = ['class' => Strategies\RandomStrategy::class];
     }
     $this->strategy = \Yii::createObject($this->strategy);
     $this->strategy->setQueue($this);
 }
 /**
  * Initialize the queue.
  * @return void
  * @throws \yii\base\InvalidConfigException If the strategy doesn't implement
  * UrbanIndo\Yii2\Queue\Strategies\Strategy.
  */
 public function init()
 {
     parent::init();
     $queueObjects = [];
     foreach ($this->queues as $id => $queue) {
         $queueObjects[$id] = \Yii::createObject($queue);
     }
     $this->queues = $queueObjects;
     if (is_array($this->strategy)) {
         $this->strategy = \Yii::createObject($this->strategy);
     } else {
         if ($this->strategy instanceof Strategy) {
             throw new \yii\base\InvalidConfigException('The strategy field have to implement UrbanIndo\\Yii2\\Queue\\Strategies\\Strategy');
         }
     }
     $this->strategy->setQueue($this);
 }