Completed
Push — master ( d66330...eb9ee0 )
by Grégoire
02:15
created

BaseCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Command;
15
16
use Sonata\Doctrine\Model\ManagerInterface;
17
use Sonata\MediaBundle\Provider\Pool;
18
use Symfony\Component\Console\Command\Command;
19
20
/**
21
 * This command can be used to re-generate the thumbnails for all uploaded medias.
22
 *
23
 * Useful if you have existing media content and added new formats.
24
 *
25
 * NEXT_MAJOR: Remove this class.
26
 *
27
 * @deprecated since sonata-project/media-bundle 3.x, to be removed in 4.0.
28
 */
29
abstract class BaseCommand extends Command
30
{
31
    /**
32
     * @var ManagerInterface
33
     */
34
    private $mediaManager;
35
36
    /**
37
     * @var Pool
38
     */
39
    private $pool;
40
41
    public function __construct(ManagerInterface $mediaManager, Pool $pool)
42
    {
43
        parent::__construct();
44
45
        $this->mediaManager = $mediaManager;
46
        $this->pool = $pool;
47
    }
48
49
    public function getMediaManager(): ManagerInterface
50
    {
51
        return $this->mediaManager;
52
    }
53
54
    public function getMediaPool(): Pool
55
    {
56
        return $this->pool;
57
    }
58
}
59