Log in
Model

DeleteContentAssetLinksByAssetIds

Magento\MediaContent\Model\DeleteContentAssetLinksByAssetIds

What it does

This class removes the relationships between media assets and content entities in Magento 2.

Developers use this when media assets are deleted or no longer associated with content (like products, pages, or blocks), ensuring the media_content_asset table stays clean and accurate.

It accepts an array of asset IDs and removes all corresponding content-asset link records.

Public Methods

  • execute()