You are here

function external_link_popup_update_8110 in External Link Pop-up 8

Update "Show close icon" for popups with empty title.

File

./external_link_popup.install, line 79
Contains external_link_popup installation and upgrade actions.

Code

function external_link_popup_update_8110() {
  $entities = \Drupal::entityTypeManager()
    ->getStorage('external_link_popup')
    ->loadMultiple();

  /* @var $entity \Drupal\external_link_popup\Entity\ExternalLinkPopup */
  foreach ($entities as $entity) {

    // Don't use loose comparison to process "0" string.
    if ($entity
      ->getTitle() === '' || $entity
      ->getTitle() === NULL) {
      $entity
        ->setClose(FALSE)
        ->save();
    }
  }
}