Completed
Push — master ( a259cb...23b0fa )
by
unknown
20:01
created

Keyword   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 15 1
1
<?php
2
3
/**
4
 * This file is part of the eZ Publish Kernel package.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\Handler;
10
11
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
12
use eZ\Publish\Core\Persistence\Database\SelectQuery;
13
14
/**
15
 * FieldValue CriterionHandler handling ezkeyword External Storage for Legacy/SQL Search.
16
 */
17
class Keyword extends Collection
18
{
19
    /**
20
     * Generates query expression for operator and value of a Field Criterion.
21
     *
22
     * @param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
23
     * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
24
     * @param string $column
25
     *
26
     * @return \eZ\Publish\Core\Persistence\Database\Expression
27
     */
28
    public function handle(SelectQuery $query, Criterion $criterion, $column)
29
    {
30
        $query
31
            ->innerJoin(
32
                $this->dbHandler->quoteTable('ezkeyword_attribute_link'),
33
                'ezcontentobject_attribute.id',
34
                'ezkeyword_attribute_link.objectattribute_id'
35
            )->innerJoin(
36
                $this->dbHandler->quoteTable('ezkeyword'),
37
                'ezkeyword.id',
38
                'ezkeyword_attribute_link.keyword_id'
39
            );
40
41
        return parent::handle($query, $criterion, 'keyword');
42
    }
43
}
44