public function resolveOrganizationName($organizationName, OutputInterface $output)
    {
        if (!$organizationName) {
            $organizationName = $this->rokkaHelper->getDefaultOrganizationName();
        }

        if (!$this->rokkaHelper->validateOrganizationName($organizationName)) {
            $output->writeln($this->formatterHelper->formatBlock([
                'Error!',
                'The organization name "'.$organizationName.'" is not valid!',
            ], 'error', true));

            return false;
        }

        $client = $this->clientProvider->getUserClient();
        if ($this->rokkaHelper->organizationExists($client, $organizationName)) {
            return $organizationName;
        }

        $output->writeln($this->formatterHelper->formatBlock([
            'Error!',
            'The organization "'.$organizationName.'" does not exists!',
        ], 'error', true));

        return false;
    }
public function resolveOrganizationName($organizationName, OutputInterface $output)
    {
        if (!$organizationName) {
            $organizationName = $this->rokkaHelper->getDefaultOrganizationName();
        }

        if (!$this->rokkaHelper->validateOrganizationName($organizationName)) {
            $output->writeln($this->formatterHelper->formatBlock([
                'Error!',
                'The organization name "'.$organizationName.'" is not valid!',
            ], 'error', true));

            return false;
        }

        $client = $this->clientProvider->getUserClient();
        if ($this->rokkaHelper->organizationExists($client, $organizationName)) {
            return $organizationName;
        }

        $output->writeln($this->formatterHelper->formatBlock([
            'Error!',
            'The organization "'.$organizationName.'" does not exists!',
        ], 'error', true));

        return false;
    }
public function resolveOrganizationName ( $ organizationName , OutputInterface $ output ) { if ( ! $ organizationName ) { $ organizationName = $ this -> rokkaHelper -> getDefaultOrganizationName ( ) ; } if ( ! $ this -> rokkaHelper -> validateOrganizationName ( $ organizationName ) ) { $ output -> writeln ( $ this -> formatterHelper -> formatBlock ( [ 'Error!' , 'The organization name "' . $ organizationName . '" is not valid!' , ] , 'error' , true ) ) ; return false ; } $ client = $ this -> clientProvider -> getUserClient ( ) ; if ( $ this -> rokkaHelper -> organizationExists ( $ client , $ organizationName ) ) { return $ organizationName ; } $ output -> writeln ( $ this -> formatterHelper -> formatBlock ( [ 'Error!' , 'The organization "' . $ organizationName . '" does not exists!' , ] , 'error' , true ) ) ; return false ; }
Get a valid organization name.

If an organization name is provided, make sure it is valid and actually exists in the API.
Otherwise return the default organization name.

@param string          $organizationName The organization name or an empty value if none is specified
@param OutputInterface $output           Console to write information for the user

@return string|bool the organization name to use or false if the provided name is not valid
Get a valid organization name .