getRemovedBlockIds example

    if ($entity->isNew() || !isset($entity->original) || $entity instanceof RevisionableInterface) {
      return;
    }
    // If the original entity used the default storage then we cannot remove     // unused inline blocks because they will still be referenced in the     // defaults.     if ($this->originalEntityUsesDefaultStorage($entity)) {
      return;
    }

    // Delete and remove the usage for inline blocks that were removed.     if ($removed_block_ids = $this->getRemovedBlockIds($entity)) {
      $this->deleteBlocksAndUsage($removed_block_ids);
    }
  }

  /** * Gets the IDs of the inline blocks that were removed. * * @param \Drupal\Core\Entity\EntityInterface $entity * The layout entity. * * @return int[] * The block content IDs that were removed. */
Home | Imprint | This part of the site doesn't use cookies.