1 | <?php |
||
22 | abstract class AbstractManagerAwareCommand extends Command |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var ContainerInterface|null |
||
27 | */ |
||
28 | private $container; |
||
29 | |||
30 | public function __construct(ContainerInterface $container) |
||
35 | |||
36 | /** |
||
37 | * @return ContainerInterface |
||
38 | * |
||
39 | * @throws \LogicException |
||
40 | */ |
||
41 | protected function getContainer() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function setContainer(ContainerInterface $container = null) |
||
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | protected function configure() |
||
76 | |||
77 | /** |
||
78 | * Returns elasticsearch manager by name from service container. |
||
79 | * |
||
80 | * @param string $name Manager name defined in configuration. |
||
81 | * |
||
82 | * @return Manager |
||
83 | * |
||
84 | * @throws \RuntimeException If manager was not found. |
||
85 | */ |
||
86 | protected function getManager($name) |
||
102 | |||
103 | /** |
||
104 | * Formats manager service id from its name. |
||
105 | * |
||
106 | * @param string $name Manager name. |
||
107 | * |
||
108 | * @return string Service id. |
||
109 | */ |
||
110 | private function getManagerId($name) |
||
114 | } |
||
115 |