setName('organization-folders:get-organization-role')
->setDescription('Get a specific organization role by id')
->addArgument('provider-id', InputArgument::REQUIRED, 'provider to query')
->addArgument('role-id', InputArgument::REQUIRED, '');
parent::configure();
}
protected function execute(InputInterface $input, OutputInterface $output): int {
try {
$providerId = $input->getArgument('provider-id');
$roleId = $input->getArgument('role-id');
if(!$this->organizationProviderManager->hasOrganizationProvider($providerId)) {
$output->writeln("organization provider not found");
return 0;
}
$role = $this->organizationProviderManager->getOrganizationProvider($providerId)->getRole($roleId);
$this->writeTableInOutputFormat($input, $output, [$this->formatTableSerializable($role)]);
return 0;
} catch (Exception $e) {
$output->writeln("Exception \"{$e->getMessage()}\" at {$e->getFile()} line {$e->getLine()}");
return 1;
}
}
}