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

        $this->labels[$code] = $value;

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

        $this->labels[$code] = $value;

        return $this;
    }
public function set_label ( $ code , $ value ) { if ( ! array_key_exists ( $ code , $ this -> labels ) ) { throw new InvalidArgumentException ( sprintf ( 'Code %s is not defined' , $ code ) ) ; } $ this -> labels [ $ code ] = $ value ; return $ this ; }
Sets a localized label for the field.

@param string      $code
@param null|string $value

@return \databox_field

@throws InvalidArgumentException
Sets a localized label for the field .