Files
kupshop/bundles/KupShop/LabelsBundle/Util/LabelUtil.php
2025-08-02 16:30:27 +02:00

22 lines
402 B
PHP

<?php
declare(strict_types=1);
namespace KupShop\LabelsBundle\Util;
use Query\Operator;
class LabelUtil
{
public function getLabelIdByCode(string $code): ?int
{
$labelId = sqlQueryBuilder()
->select('id')
->from('labels')
->where(Operator::equals(['code' => $code]))
->execute()->fetchOne();
return $labelId ?: null;
}
}