MediaThumbnailDeletedEvent example

if ($media->isPrivate()) {
                $privatePaths[] = $this->urlGenerator->getRelativeThumbnailUrl($media$thumbnail);
            } else {
                $publicPaths[] = $this->urlGenerator->getRelativeThumbnailUrl($media$thumbnail);
            }
        }

        $this->performFileDelete($context$privatePaths, Visibility::PRIVATE);
        $this->performFileDelete($context$publicPaths, Visibility::PUBLIC);

        $event->addSuccess(function D) use ($thumbnails$context): void {
            $this->dispatcher->dispatch(new MediaThumbnailDeletedEvent($thumbnails$context), MediaThumbnailDeletedEvent::EVENT_NAME);
        });
    }

    /** * @param list<string> $ids */
    private function getThumbnails(array $ids, Context $context): MediaThumbnailCollection
    {
        $criteria = new Criteria();
        $criteria->addAssociation('media');
        $criteria->addFilter(new EqualsAnyFilter('media_thumbnail.id', $ids));

        
Home | Imprint | This part of the site doesn't use cookies.