Completed
Push — master ( b55ca8...f3fba8 )
by Kamil
20:16 queued 07:20
created

ProductAttributeValueRepository   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A findByJsonChoiceKey() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Sylius\Bundle\ProductBundle\Doctrine\ORM;
15
16
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
17
use Sylius\Component\Product\Repository\ProductAttributeValueRepositoryInterface;
18
19
class ProductAttributeValueRepository extends EntityRepository implements ProductAttributeValueRepositoryInterface
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function findByJsonChoiceKey(string $choiceKey): array
25
    {
26
        return $this->createQueryBuilder('o')
27
            ->andWhere('o.json LIKE :key')
28
            ->setParameter('key', '%"' . $choiceKey . '"%')
29
            ->getQuery()
30
            ->getResult()
31
        ;
32
    }
33
}
34