Completed
Push — master ( e16616...2d6e36 )
by
unknown
19:26 queued 03:33
created

SectionId   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A accept() 0 4 1
A handle() 0 8 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\URL\Query\CriterionHandler;
10
11
use eZ\Publish\API\Repository\Values\URL\Query\Criterion;
12
use eZ\Publish\Core\Persistence\Database\SelectQuery;
13
use eZ\Publish\Core\Persistence\Legacy\URL\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, SelectQuery $query, Criterion $criterion): string
29
    {
30
        $this->joinContentObjectLink($query);
31
        $this->joinContentObjectAttribute($query);
32
        $this->joinContentObject($query);
33
34
        return $query->expr->in('ezcontentobject.section_id', $criterion->sectionIds);
0 ignored issues
show
Bug introduced by
The property sectionIds does not seem to exist in eZ\Publish\API\Repositor...ues\URL\Query\Criterion.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
35
    }
36
}
37