Completed
Push — master ( eec98d...dbbf84 )
by Grégoire
05:16
created

CategoryManager   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 63
rs 10
c 0
b 0
f 0
wmc 7
lcom 1
cbo 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRootCategory() 0 4 1
A getRootCategories() 0 4 1
A find() 0 4 1
A findBy() 0 4 1
A create() 0 4 1
A save() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\MediaBundle\Model;
13
14
use Sonata\ClassificationBundle\Model\CategoryManagerInterface as ManagerInterface;
15
16
/**
17
 * @author Joao Albuquerque <[email protected]>
18
 * @author Christian Gripp <[email protected]>
19
 */
20
final class CategoryManager implements CategoryManagerInterface
21
{
22
    /**
23
     * @var ManagerInterface
24
     */
25
    private $categoryManager;
26
27
    /**
28
     * @param ManagerInterface $categoryManager
29
     */
30
    public function __construct(ManagerInterface $categoryManager)
31
    {
32
        $this->categoryManager = $categoryManager;
33
    }
34
35
    /**
36
     * {@inheritdoc}
37
     */
38
    public function getRootCategory($context)
39
    {
40
        return $this->categoryManager->getRootCategory($context);
41
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getRootCategories($loadChildren = true)
47
    {
48
        return $this->categoryManager->getRootCategories($loadChildren);
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function find($categoryId)
55
    {
56
        return $this->categoryManager->find($categoryId);
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function findBy(array $criteria)
63
    {
64
        return $this->categoryManager->findBy($criteria);
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function create()
71
    {
72
        return $this->categoryManager->create();
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function save($category)
79
    {
80
        $this->categoryManager->save($category);
81
    }
82
}
83