src/Generator/Analyzer/Steps/AnalyzeSluggableInteractive.php
protected function createCandidateArrayForIterativeUserSelection($moduleId)
    {
        $candidate = [
            'translated'              => null,
            'slug_column'             => null,
            'slug_sources_normal'     => $this->context->output['models'][ $moduleId ]['normal_attributes'],
            'slug_sources_translated' => $this->context->output['models'][ $moduleId ]['translated_attributes'],
        ];

        if ( ! count($candidate['slug_sources_translated'])) {

            $candidate['translated'] = false;

        } elseif ( ! count($candidate['slug_sources_normal'])) {

            $candidate['translated'] = true;

        } else {
            // ask the user
            $candidate['translated'] = $this->context->command->choice(
                    "Should the slug source be a translated attribute or not?",
                    [ 'normal model attribute', 'translated attribute' ]
                ) == 'translated attribute';
        }

        return $candidate;
    }
protected function createCandidateArrayForIterativeUserSelection($moduleId)
    {
        $candidate = [
            'translated'              => null,
            'slug_column'             => null,
            'slug_sources_normal'     => $this->context->output['models'][ $moduleId ]['normal_attributes'],
            'slug_sources_translated' => $this->context->output['models'][ $moduleId ]['translated_attributes'],
        ];

        if ( ! count($candidate['slug_sources_translated'])) {

            $candidate['translated'] = false;

        } elseif ( ! count($candidate['slug_sources_normal'])) {

            $candidate['translated'] = true;

        } else {
            // ask the user
            $candidate['translated'] = $this->context->command->choice(
                    "Should the slug source be a translated attribute or not?",
                    [ 'normal model attribute', 'translated attribute' ]
                ) == 'translated attribute';
        }

        return $candidate;
    }
protected function createCandidateArrayForIterativeUserSelection ( $ moduleId ) { $ candidate = [ 'translated' => null , 'slug_column' => null , 'slug_sources_normal' => $ this -> context -> output [ 'models' ] [ $ moduleId ] [ 'normal_attributes' ] , 'slug_sources_translated' => $ this -> context -> output [ 'models' ] [ $ moduleId ] [ 'translated_attributes' ] , ] ; if ( ! count ( $ candidate [ 'slug_sources_translated' ] ) ) { $ candidate [ 'translated' ] = false ; } elseif ( ! count ( $ candidate [ 'slug_sources_normal' ] ) ) { $ candidate [ 'translated' ] = true ; } else { // ask the user $ candidate [ 'translated' ] = $ this -> context -> command -> choice ( "Should the slug source be a translated attribute or not?" , [ 'normal model attribute' , 'translated attribute' ] ) == 'translated attribute' ; } return $ candidate ; }
Creates candidate array for handling sluggable interactive process for the user selection approach

@param int $moduleId
@return array
Creates candidate array for handling sluggable interactive process for the user selection approach