<?php
/**
 * @author 1902 Software
 * @copyright Copyright © 2023 1902 Software (https://1902software.com/magento/)
 * @package WriteTextAI_WriteTextAI
 */

namespace WriteTextAI\WriteTextAI\Helper\Categories;

use Magento\Framework\App\Helper\AbstractHelper;

class RepresentativeProducts extends AbstractHelper
{
    /**
     * Get product attributes selected
     *
     * @param \WriteTextAI\WriteTextAI\Model\AiCategory $aiCategory
     * @return array
     */
    public function getRepresentativeProductsSelected($aiCategory)
    {
        $result = [];

        if ($aiCategory->getRepresentativeProductsSelected()) {
            $result = json_decode($aiCategory->getRepresentativeProductsSelected());
        }

        return $result;
    }
}
