diff options
author | Sean Molenaar <sean@seanmolenaar.eu> | 2020-08-29 23:39:35 +0200 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-09-27 15:35:31 +0200 |
commit | d00d1ab2a28f428223e52b17052c072c64784016 (patch) | |
tree | c019f85fb7ac67147dd43ca64b4ac3cda99832f7 /lib/Command/Updater/AllFeeds.php | |
parent | 5687baca75d47dbdffd3de74e865ad2f71ef0cb7 (diff) |
Create V2 mapper, Service and management commands
Signed-off-by: Sean Molenaar <sean@seanmolenaar.eu>
Diffstat (limited to 'lib/Command/Updater/AllFeeds.php')
-rw-r--r-- | lib/Command/Updater/AllFeeds.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/Command/Updater/AllFeeds.php b/lib/Command/Updater/AllFeeds.php index 93ef4e59a..6993d51ea 100644 --- a/lib/Command/Updater/AllFeeds.php +++ b/lib/Command/Updater/AllFeeds.php @@ -11,19 +11,24 @@ namespace OCA\News\Command\Updater; -use Exception; - +use OCA\News\Service\FeedServiceV2; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use OCA\News\Service\FeedService; - class AllFeeds extends Command { + /** + * @var FeedServiceV2 Feed service + */ private $feedService; - public function __construct(FeedService $feedService) + /** + * AllFeeds constructor. + * + * @param FeedServiceV2 $feedService + */ + public function __construct(FeedServiceV2 $feedService) { parent::__construct(); $this->feedService = $feedService; @@ -35,6 +40,7 @@ class AllFeeds extends Command $this->setName('news:updater:all-feeds') ->setDescription( + 'DEPRECATED: use news:feed:list instead.' . PHP_EOL . 'Prints a JSON string which contains all feed ' . 'ids and user ids, e.g.: ' . $json ); @@ -42,7 +48,7 @@ class AllFeeds extends Command protected function execute(InputInterface $input, OutputInterface $output) { - $feeds = $this->feedService->findAllFromAllUsers(); + $feeds = $this->feedService->findAll(); $result = ['feeds' => []]; foreach ($feeds as $feed) { @@ -53,6 +59,6 @@ class AllFeeds extends Command ]; } - print(json_encode($result)); + $output->write(json_encode($result)); } } |