* @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) */ namespace PrestaShop\PrestaShop\Adapter\Product; use Product; /** * Retrieve colors of a Product, if any. */ class ProductColorsRetriever { /** * @param int $id_product * * @return mixed|null */ public function getColoredVariants($id_product) { $attributesColorList = Product::getAttributesColorList([$id_product]); return (is_array($attributesColorList)) ? current($attributesColorList) : null; } }