You are here

public function EntityShareCronService::enqueue in Entity Share Cron 3.0.x

Same name and namespace in other branches
  1. 8.2 src/EntityShareCronService.php \Drupal\entity_share_cron\EntityShareCronService::enqueue()
  2. 8 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.

null|string $url: The url of the page to enqueue for import. NULL if starting from the first page.

Overrides EntityShareCronServiceInterface::enqueue

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

File

src/EntityShareCronService.php, line 75

Class

EntityShareCronService
Entity Share Cron service.

Namespace

Drupal\entity_share_cron

Code

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