0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-12-06 11:22:41 +01:00

added work-in-progress organization folder occ commands

This commit is contained in:
Jonathan Treffler 2024-10-30 04:47:47 +01:00
parent 840fd70c37
commit 851fa0a1cc
5 changed files with 175 additions and 0 deletions

View file

@ -0,0 +1,31 @@
<?php
namespace OCA\OrganizationFolders\Command\OrganizationFolder;
use OCP\DB\Exception;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use OCA\OrganizationFolders\Command\BaseCommand;
class ListOrganizationFolders extends BaseCommand {
protected function configure(): void {
$this
->setName('organization-folders:list')
->setDescription('List all organization folders');
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$organizationFolderGroupfolders = $this->organizationFolderService->getAll();
$this->writeTableInOutputFormat($input, $output, $this->formatOrganizationFolders($organizationFolderGroupfolders));
return 0;
} catch (Exception $e) {
$output->writeln("<error>Exception \"{$e->getMessage()}\" at {$e->getFile()} line {$e->getLine()}</error>");
return 1;
}
}
}