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

ContentId::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
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 ContentId extends Base
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function accept(Criterion $criterion): bool
21
    {
22
        return $criterion instanceof Criterion\ContentId;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function handle(CriteriaConverter $converter, QueryBuilder $query, Criterion $criterion): string
29
    {
30
        return $this->operateInt($query, 'content.id', $criterion);
31
    }
32
}
33