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

CategoryManager::findBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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