You are here

public function EntityShareCronService::enqueue in Entity Share Cron 8

Same name and namespace in other branches
  1. 8.2 src/EntityShareCronService.php \Drupal\entity_share_cron\EntityShareCronService::enqueue()
  2. 3.0.x src/EntityShareCronService.php \Drupal\entity_share_cron\EntityShareCronService::enqueue()

Enqueues a channel for later synchronization.

Parameters

string $remote_id: The ID of the remote the channel belongs to.

string $channel_id: The ID of the channel to be enqueued.

array $channel_info: Channel info.

Overrides EntityShareCronServiceInterface::enqueue

1 call to EntityShareCronService::enqueue()
EntityShareCronService::sync in src/EntityShareCronService.php
Synchronizes entities starting from provided channel URL.

File

src/EntityShareCronService.php, line 84

Class

EntityShareCronService
Entity Share Cron service.

Namespace

Drupal\entity_share_cron

Code

public function enqueue($remote_id, $channel_id, array $channel_info) {
  $queue_name = EntityShareCronServiceInterface::PENDING_QUEUE_NAME;
  $queue = $this->queueFactory
    ->get($queue_name);
  $item = [
    'remote_id' => $remote_id,
    'channel_id' => $channel_id,
    'channel_info' => $channel_info,
  ];
  $queue
    ->createItem($item);
}