1 | <?php |
||
18 | class ListHandlerCommand extends ContainerAwareCommand |
||
19 | { |
||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | public function configure() |
||
24 | { |
||
25 | $this->setName('sonata:notification:list-handler'); |
||
26 | $this->setDescription('List all consumers available'); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | public function execute(InputInterface $input, OutputInterface $output) |
||
33 | { |
||
34 | $output->writeln('<info>List of consumers available</info>'); |
||
35 | foreach ($this->getMetadata() as $type => $ids) { |
||
36 | foreach ($ids as $id) { |
||
37 | $output->writeln(sprintf('<info>%s</info> - <comment>%s</comment>', $type, $id)); |
||
38 | } |
||
39 | } |
||
40 | |||
41 | $output->writeln(' done!'); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @return array |
||
46 | */ |
||
47 | private function getMetadata() |
||
51 | } |
||
52 |