* @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\Grid\Action\Row\AccessibilityChecker; use Category; use PrestaShop\PrestaShop\Core\Grid\Action\Row\AccessibilityChecker\AccessibilityCheckerInterface; /** * Class CategoryForViewAccessibilityChecker. * * @internal */ final class CategoryForViewAccessibilityChecker implements AccessibilityCheckerInterface { /** * @var int */ private $contextLangId; /** * @param int $contextLangId */ public function __construct($contextLangId) { $this->contextLangId = $contextLangId; } /** * {@inheritdoc} */ public function isGranted(array $category) { return Category::hasChildren($category['id_category'], $this->contextLangId, false); } }