public function getLanguageId(string $shortCode): string
    {
        $query = $this->Languages->find('all', [
            'conditions' => ['Languages.code' => $shortCode]
        ]);
        $language = $query->first();

        if (empty($language->id)) {
            throw new InvalidArgumentException("Unsupported language code [$shortCode]");
        }

        return $language->id;
    }
public function getLanguageId(string $shortCode): string
    {
        $query = $this->Languages->find('all', [
            'conditions' => ['Languages.code' => $shortCode]
        ]);
        $language = $query->first();

        if (empty($language->id)) {
            throw new InvalidArgumentException("Unsupported language code [$shortCode]");
        }

        return $language->id;
    }
public function getLanguageId ( string $ shortCode ) : string { $ query = $ this -> Languages -> find ( 'all' , [ 'conditions' => [ 'Languages.code' => $ shortCode ] ] ) ; $ language = $ query -> first ( ) ; if ( empty ( $ language -> id ) ) { throw new InvalidArgumentException ( "Unsupported language code [$shortCode]" ) ; } return $ language -> id ; }
Retrive language ID by code

@throws \InvalidArgumentException for unknown short code
@param string $shortCode     language code i.e. ru, cn etc
@return string              language's uuid
Retrive language ID by code