protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->outputHandler->initialize($input, $output);

        $identity = $this->identityService->findOneBy([
            'objectIdentifier' => $input->getArgument('identifier'),
        ]);

        if (null === $identity) {
            $this->outputHandler->writeLine('could not find identity for identifier');

            return;
        }

        $i = 1;
        $definitions = $this->definitionProvider->getConnectorDefinitions($identity->getObjectType());

        foreach ($definitions as $definition) {
            $result = $this->serviceBus->handle(new FetchTransferObjectQuery(
                $definition->getOriginAdapterName(),
                $definition->getObjectType(),
                QueryType::ONE,
                $input->getArgument('identifier')
            ));

            if (!$result) {
                $this->outputHandler->writeLine('could not find TransferObject');

                continue;
            }

            foreach ($result as $item) {
                $this->outputHandler->writeLine();
                $this->outputHandler->writeLine(sprintf('TransferObject %s:', $i++));
                $this->outputHandler->writeLine(json_encode($item, JSON_PRETTY_PRINT));
            }
        }
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->outputHandler->initialize($input, $output);

        $identity = $this->identityService->findOneBy([
            'objectIdentifier' => $input->getArgument('identifier'),
        ]);

        if (null === $identity) {
            $this->outputHandler->writeLine('could not find identity for identifier');

            return;
        }

        $i = 1;
        $definitions = $this->definitionProvider->getConnectorDefinitions($identity->getObjectType());

        foreach ($definitions as $definition) {
            $result = $this->serviceBus->handle(new FetchTransferObjectQuery(
                $definition->getOriginAdapterName(),
                $definition->getObjectType(),
                QueryType::ONE,
                $input->getArgument('identifier')
            ));

            if (!$result) {
                $this->outputHandler->writeLine('could not find TransferObject');

                continue;
            }

            foreach ($result as $item) {
                $this->outputHandler->writeLine();
                $this->outputHandler->writeLine(sprintf('TransferObject %s:', $i++));
                $this->outputHandler->writeLine(json_encode($item, JSON_PRETTY_PRINT));
            }
        }
    }
{@inheritdoc}