Completed
Push — EZP-31084-part2-poc ( f20bda )
by André
19:16
created

SectionId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A accept() 0 4 1
A handle() 0 4 1
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\Persistence\Legacy\Content\Query\CriterionHandler;
10
11
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
12
use Doctrine\DBAL\Query\QueryBuilder;
13
use eZ\Publish\Core\Persistence\Legacy\Content\Query\CriteriaConverter;
14
15
class SectionId extends Base
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function accept(Criterion $criterion): bool
21
    {
22
        return $criterion instanceof Criterion\SectionId;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function handle(CriteriaConverter $converter, QueryBuilder $query, Criterion $criterion): string
29
    {
30
        return $this->operateInt($query, 'content.section_id', $criterion);
31
    }
32
}
33