1

I've been trying to understand, How Magento is managing the category_ids attribute for product in database and on code level? I noticed this attribute is handled in a different way to the other static backend_type eav attributes.

If someone has already got chance to analyze it, his finding can save time for me. Thanks

1 Answer 1

3

This isn't a static attribute, this a relation between two entities and it's stored in the catalog_category_product table. The model related is \Magento\Catalog\Model\CategoryLink

Take a look at \Magento\Catalog\Model\ResourceModel\Product, you can see the getCategoryIds method that calls \Magento\Catalog\Model\ResourceModel\Product\CategoryLink::getCategoryLinks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.