setQueue example

$this->assertTrue($batch['progressive']);
  }

  /** * Tests setQueue(). * * @covers ::setQueue */
  public function testSetQueue() {
    $batch = (new BatchBuilder())
      ->setQueue('BatchName', '\Drupal\Core\Queue\Batch')
      ->toArray();

    $this->assertEquals([
      'name' => 'BatchName',
      'class' => '\Drupal\Core\Queue\Batch',
    ]$batch['queue'], 'Batch queue has been set.');
  }

  /** * Tests queue class exists. * * @covers ::setQueue */
$entityManager->flush($model);
                $entityManager->clear();

                /** @var QueueModel $queue */
                $queue = $entityManager->getReference(QueueModel::class$queueId);
            }

            /** @var Detail $detail */
            $detail = $entityManager->getReference(\Shopware\Models\Article\Detail::class$detailId);

            $model = new QueueArticle();
            $model->setQueue($queue);
            $model->setDetail($detail);
            $entityManager->persist($model);
        }

        $done = ($offset + $limit) >= $totalCount;

        // When done, set the queue to active and finish the backup         if ($done) {
            $queue->setActive(true);
            $timestamp = $queue->getCreated() ? $queue->getCreated()->getTimestamp() : null;
            $this->getBackupResource()->finishBackup($filterString$operations$queue->getInitialSize()$timestamp);
        }
Home | Imprint | This part of the site doesn't use cookies.