You are here

public function UpgradeManager::upgrade in Video Embed Field 8

Upgrade the existing media_entity_embedded_video bundles.

Overrides UpgradeManagerInterface::upgrade

File

modules/video_embed_media/src/UpgradeManager.php, line 35

Class

UpgradeManager
Upgrades existing media_entity_embedded_video bundles.

Namespace

Drupal\video_embed_media

Code

public function upgrade() {
  $entities = $this->entityQuery
    ->get('media_bundle')
    ->condition('type', 'embeddable_video')
    ->execute();
  foreach ($entities as $entity) {
    $bundle = MediaBundle::load($entity);
    $this
      ->upgradeBundle($bundle);
  }
}