mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-12-06 11:22:41 +01:00
Added organization folder member occ commands
This commit is contained in:
parent
afb731e56b
commit
fb3f9836a2
5 changed files with 125 additions and 3 deletions
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\OrganizationFolders\Command\OrganizationFolderMember;
|
||||
|
||||
use OCP\DB\Exception;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
use OCA\OrganizationFolders\Command\BaseCommand;
|
||||
|
||||
class ListOrganizationFolderMembers extends BaseCommand {
|
||||
protected function configure(): void {
|
||||
$this
|
||||
->setName('organization-folders:members:list')
|
||||
->addArgument('organization-folder-id', InputArgument::REQUIRED, 'Id of organization folder')
|
||||
->setDescription('List all members of organization folder.');
|
||||
|
||||
parent::configure();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
try {
|
||||
$organizationFolderId = $input->getArgument('organization-folder-id');
|
||||
|
||||
$members = $this->organizationFolderMemberService->findAll($organizationFolderId);
|
||||
|
||||
$this->writeTableInOutputFormat($input, $output, $this->formatTableSerializables($members));
|
||||
return 0;
|
||||
} catch (Exception $e) {
|
||||
$output->writeln("<error>Exception \"{$e->getMessage()}\" at {$e->getFile()} line {$e->getLine()}</error>");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue