You are here

public function SyncCoreBatchCollection::get in CMS Content Sync 2.1.x

Same name and namespace in other branches
  1. 8 src/SyncCoreBatchCollection.php \Drupal\cms_content_sync\SyncCoreBatchCollection::get()
  2. 2.0.x src/SyncCoreBatchCollection.php \Drupal\cms_content_sync\SyncCoreBatchCollection::get()

Get an existing item by ID.

Parameters

$id:

$type:

File

src/SyncCoreBatchCollection.php, line 20

Class

SyncCoreBatchCollection
Class SyncCoreBatchCollection.

Namespace

Drupal\cms_content_sync

Code

public function get($id, $type) {
  foreach ($this->operations as $operation) {
    if ($operation['type'] !== $type) {
      continue;
    }
    if ($operation['item']['id'] !== $id) {
      continue;
    }
    return $operation['item'];
  }
  return null;
}