first commit
This commit is contained in:
21
bundles/KupShop/LabelsBundle/Util/LabelUtil.php
Normal file
21
bundles/KupShop/LabelsBundle/Util/LabelUtil.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user