Completed
Pull Request — master (#1)
by Rafał
02:55
created

PrefixCandidates   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPrefixes() 0 6 1
A setPathBuilder() 0 4 1
A setRoutePathsNames() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Superdesk Web Publisher MultiTenancy Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.u. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú.
12
 * @license http://www.superdesk.org/license
13
 */
14
namespace SWP\MultiTenancyBundle\Doctrine\PHPCR;
15
16
use SWP\Component\MultiTenancy\PathBuilder\TenantAwarePathBuilderInterface;
17
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\PrefixCandidates as BasePrefixCandidates;
18
19
/**
20
 * Class PrefixCandidates.
21
 */
22
class PrefixCandidates extends BasePrefixCandidates
23
{
24
    /**
25
     * @var TenantAwarePathBuilderInterface
26
     */
27
    protected $pathBuilder;
28
29
    /**
30
     * @var array
31
     */
32
    protected $routePathsNames = [];
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getPrefixes()
38
    {
39
        $this->idPrefixes = (array) $this->pathBuilder->build($this->routePathsNames);
40
41
        return $this->idPrefixes;
42
    }
43
44
    /**
45
     * Sets path builder.
46
     *
47
     * @param TenantAwarePathBuilderInterface $pathBuilder
48
     */
49
    public function setPathBuilder(TenantAwarePathBuilderInterface $pathBuilder)
50
    {
51
        $this->pathBuilder = $pathBuilder;
52
    }
53
54
    /**
55
     * @param array $routePathsNames
56
     */
57
    public function setRoutePathsNames(array $routePathsNames = [])
58
    {
59
        $this->routePathsNames = $routePathsNames;
60
    }
61
}
62