public function SyncCoreBatchCollection::get in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/SyncCoreBatchCollection.php \Drupal\cms_content_sync\SyncCoreBatchCollection::get()
- 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_syncCode
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;
}