protected function create($step)
    {
        $languageService = $this->repository->getContentLanguageService();

        if (!isset($step->dsl['lang'])) {
            throw new \Exception("The 'lang' key is required to create a new language.");
        }

        $languageCreateStruct = $languageService->newLanguageCreateStruct();
        $languageCreateStruct->languageCode = $this->referenceResolver->resolveReference($step->dsl['lang']);
        if (isset($step->dsl['name'])) {
            $languageCreateStruct->name = $this->referenceResolver->resolveReference($step->dsl['name']);
        }
        if (isset($step->dsl['enabled'])) {
            $languageCreateStruct->enabled = (bool)$this->referenceResolver->resolveReference($step->dsl['enabled']);
        }
        $language = $languageService->createLanguage($languageCreateStruct);

        $this->setReferences($language, $step);

        return $language;
    }
protected function create($step)
    {
        $languageService = $this->repository->getContentLanguageService();

        if (!isset($step->dsl['lang'])) {
            throw new \Exception("The 'lang' key is required to create a new language.");
        }

        $languageCreateStruct = $languageService->newLanguageCreateStruct();
        $languageCreateStruct->languageCode = $this->referenceResolver->resolveReference($step->dsl['lang']);
        if (isset($step->dsl['name'])) {
            $languageCreateStruct->name = $this->referenceResolver->resolveReference($step->dsl['name']);
        }
        if (isset($step->dsl['enabled'])) {
            $languageCreateStruct->enabled = (bool)$this->referenceResolver->resolveReference($step->dsl['enabled']);
        }
        $language = $languageService->createLanguage($languageCreateStruct);

        $this->setReferences($language, $step);

        return $language;
    }
protected function create ( $ step ) { $ languageService = $ this -> repository -> getContentLanguageService ( ) ; if ( ! isset ( $ step -> dsl [ 'lang' ] ) ) { throw new \ Exception ( "The 'lang' key is required to create a new language." ) ; } $ languageCreateStruct = $ languageService -> newLanguageCreateStruct ( ) ; $ languageCreateStruct -> languageCode = $ this -> referenceResolver -> resolveReference ( $ step -> dsl [ 'lang' ] ) ; if ( isset ( $ step -> dsl [ 'name' ] ) ) { $ languageCreateStruct -> name = $ this -> referenceResolver -> resolveReference ( $ step -> dsl [ 'name' ] ) ; } if ( isset ( $ step -> dsl [ 'enabled' ] ) ) { $ languageCreateStruct -> enabled = ( bool ) $ this -> referenceResolver -> resolveReference ( $ step -> dsl [ 'enabled' ] ) ; } $ language = $ languageService -> createLanguage ( $ languageCreateStruct ) ; $ this -> setReferences ( $ language , $ step ) ; return $ language ; }
Handles the language create migration action

@todo allow creating disabkled languages
Handles the language create migration action