public function ask(MetaDataSource $metadataSource, $choice = null)
    {
        $metaDataCollection = $this->getMetadataDao($metadataSource)->getAllMetadata();
        $responseCollection = new PredefinedResponseCollection();

        foreach ($metaDataCollection as $metaData) {
            $response = new PredefinedResponse($metaData->getOriginalName(), $metaData->getOriginalName(), $metaData);
            $response->setAdditionalData(array('source' => $metadataSource->getUniqueName()));

            $responseCollection->append($response);
        }

        $question = new QuestionWithPredefinedResponse(
            "Select Metadata",
            self::QUESTION_KEY,
            $responseCollection
        );
        $question->setPreselectedResponse($choice);
        $question->setShutdownWithoutResponse(true);

        return $this->context->askCollection($question);
    }
public function ask(MetaDataSource $metadataSource, $choice = null)
    {
        $metaDataCollection = $this->getMetadataDao($metadataSource)->getAllMetadata();
        $responseCollection = new PredefinedResponseCollection();

        foreach ($metaDataCollection as $metaData) {
            $response = new PredefinedResponse($metaData->getOriginalName(), $metaData->getOriginalName(), $metaData);
            $response->setAdditionalData(array('source' => $metadataSource->getUniqueName()));

            $responseCollection->append($response);
        }

        $question = new QuestionWithPredefinedResponse(
            "Select Metadata",
            self::QUESTION_KEY,
            $responseCollection
        );
        $question->setPreselectedResponse($choice);
        $question->setShutdownWithoutResponse(true);

        return $this->context->askCollection($question);
    }
public function ask ( MetaDataSource $ metadataSource , $ choice = null ) { $ metaDataCollection = $ this -> getMetadataDao ( $ metadataSource ) -> getAllMetadata ( ) ; $ responseCollection = new PredefinedResponseCollection ( ) ; foreach ( $ metaDataCollection as $ metaData ) { $ response = new PredefinedResponse ( $ metaData -> getOriginalName ( ) , $ metaData -> getOriginalName ( ) , $ metaData ) ; $ response -> setAdditionalData ( array ( 'source' => $ metadataSource -> getUniqueName ( ) ) ) ; $ responseCollection -> append ( $ response ) ; } $ question = new QuestionWithPredefinedResponse ( "Select Metadata" , self :: QUESTION_KEY , $ responseCollection ) ; $ question -> setPreselectedResponse ( $ choice ) ; $ question -> setShutdownWithoutResponse ( true ) ; return $ this -> context -> askCollection ( $ question ) ; }
Ask wich metadata you want to use
@param  MetaDataSource                              $metadataSource
@param  string|null                                 $choice
@throws ResponseExpectedException
@return \CrudGenerator\Metadata\DataObject\MetaData
Ask wich metadata you want to use