Log in
Model

Gallery

Magento\Catalog\Model\ResourceModel\Product\Gallery

What it does

This resource model manages product media gallery database operations in Magento 2.

Developers use it to load, insert, update, and delete product images and their metadata across stores, including binding images to products, duplicating galleries when copying products, and managing store-specific image attributes like labels, positions, and disabled status.

Public Methods

  • getConnection()
  • loadDataFromTableByValueId()
  • loadProductGalleryByAttributeId()
  • createBatchBaseSelect()
  • getMainTableAlias()
  • bindValueToEntity()
  • saveDataRow()
  • insertGallery()
  • deleteGallery()
  • insertGalleryValueInStore()
  • deleteGalleryValueInStore()
  • duplicate()
  • getProductImages()
  • countImageUses()