src/Genesis/API/Request/WPF/Create.php
public function setLanguage($language = \Genesis\API\Constants\i18n::EN)
    {
        // Strip the input down to two letters
        $language = substr(strtolower($language), 0, 2);

        if (!\Genesis\API\Constants\i18n::isValidLanguageCode($language)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'The provided argument is not a valid ISO-639-1 language code!'
            );
        }

        $this->setApiConfig(
            'url',
            $this->buildRequestURL(
                'wpf',
                sprintf('%s/wpf', $language),
                false
            )
        );

        return $this;
    }
public function setLanguage($language = \Genesis\API\Constants\i18n::EN)
    {
        // Strip the input down to two letters
        $language = substr(strtolower($language), 0, 2);

        if (!\Genesis\API\Constants\i18n::isValidLanguageCode($language)) {
            throw new \Genesis\Exceptions\InvalidArgument(
                'The provided argument is not a valid ISO-639-1 language code!'
            );
        }

        $this->setApiConfig(
            'url',
            $this->buildRequestURL(
                'wpf',
                sprintf('%s/wpf', $language),
                false
            )
        );

        return $this;
    }
public function setLanguage ( $ language = \ Genesis \ API \ Constants \ i18n :: EN ) { // Strip the input down to two letters $ language = substr ( strtolower ( $ language ) , 0 , 2 ) ; if ( ! \ Genesis \ API \ Constants \ i18n :: isValidLanguageCode ( $ language ) ) { throw new \ Genesis \ Exceptions \ InvalidArgument ( 'The provided argument is not a valid ISO-639-1 language code!' ) ; } $ this -> setApiConfig ( 'url' , $ this -> buildRequestURL ( 'wpf' , sprintf ( '%s/wpf' , $ language ) , false ) ) ; return $ this ; }
Add ISO 639-1 language code to the URL

@param string $language iso code of the language

@return $this

@throws \Genesis\Exceptions\InvalidArgument
Add ISO 639 - 1 language code to the URL