clearReplacementId example


  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage$entities);

    /** @var \Drupal\image\ImageStyleInterface[] $entities */
    foreach ($entities as $style) {
      // Flush cached media for the deleted style.       $style->flush();
      // Clear the replacement ID, if one has been previously stored.       /** @var \Drupal\image\ImageStyleStorageInterface $storage */
      $storage->clearReplacementId($style->id());
    }
  }

  /** * Update field settings if the image style name is changed. * * @param \Drupal\image\ImageStyleInterface $style * The image style. */
  protected static function replaceImageStyle(ImageStyleInterface $style) {
    if ($style->id() != $style->getOriginalId()) {
      
Home | Imprint | This part of the site doesn't use cookies.