You can retrieve the attribute set data by id in Magento 2 to know about attribute details.
You can use Magento\Catalog\Api\AttributeSetRepositoryInterface to retrieve the attribute set info with get($attributeId) method.
Output will be entity_type_id, attribute_set_name and sort order of the attribute set.
<?php namespace Jesadiya\AttributeSet\Model; use Exception; use Magento\Eav\Api\Data\AttributeSetInterface; use Magento\Catalog\Api\AttributeSetRepositoryInterface; class AttributeSet { /** * @var AttributeSetRepositoryInterface */ private $attributeSetRepository; public function __construct( AttributeSetRepositoryInterface $attributeSetRepository ) { $this->attributeSetRepository = $attributeSetRepository; } /** * @param int $attributeSetId * @return AttributeSetInterface */ public function getAttributeSet($attributeSetId) { try { $attributeSet = $this->attributeSetRepository->get($attributeSetId); } catch (Exception $exception) { throw new Exception($exception->getMessage()); } return $attributeSet; } }
Call getAttributeSet method from the PHP class or tempalte file to explore the result,
$attributeSetId = 4; $attributeSet = $this->getAttributeIdbyProductIds($attributeSetId); echo "<pre>";print_r($attributeSet->debug());
Output
Array ( [attribute_set_id] => 4 [entity_type_id] => 4 [attribute_set_name] => Default [sort_order] => 1 )