public function get_label($code)
    {
        if (!array_key_exists($code, $this->labels)) {
            throw new InvalidArgumentException(sprintf('Code %s is not defined', $code));
        }

        return isset($this->labels[$code]) && '' !== $this->labels[$code] ? $this->labels[$code] : $this->name;
    }
public function get_label($code)
    {
        if (!array_key_exists($code, $this->labels)) {
            throw new InvalidArgumentException(sprintf('Code %s is not defined', $code));
        }

        return isset($this->labels[$code]) && '' !== $this->labels[$code] ? $this->labels[$code] : $this->name;
    }
public function get_label ( $ code ) { if ( ! array_key_exists ( $ code , $ this -> labels ) ) { throw new InvalidArgumentException ( sprintf ( 'Code %s is not defined' , $ code ) ) ; } return isset ( $ this -> labels [ $ code ] ) && '' !== $ this -> labels [ $ code ] ? $ this -> labels [ $ code ] : $ this -> name ; }
Gets a localized label for the field.

@param string $code

@return string

@throws InvalidArgumentException
Gets a localized label for the field .