LogEntryRepository   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 10
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createByOwnerIdQueryBuilder() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Setono\SyliusLogEntryPlugin\Doctrine\ORM;
6
7
use Doctrine\ORM\QueryBuilder;
8
use Setono\SyliusLogEntryPlugin\Repository\LogEntryRepositoryInterface;
9
use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository;
10
use Webmozart\Assert\Assert;
11
12
class LogEntryRepository extends EntityRepository implements LogEntryRepositoryInterface
13
{
14
    public function createByOwnerIdQueryBuilder($id): QueryBuilder
15
    {
16
        Assert::scalar($id);
17
18
        return $this->createQueryBuilder('o')
19
            ->innerJoin('o.owner', 'owner')
20
            ->andWhere('owner.id = :id')
21
            ->setParameter('id', $id)
22
            ;
23
    }
24
}
25