public function setFormat($format)
    {
        if (!in_array($format, $this->formats)) {
            $msg = "The '%s' format is not allowed. Try with '%s'";
            throw new InvalidArgumentException(sprintf($msg, $format, implode("', '", $this->formats)));
        }

        $this->format = $format;

        return $this;
    }
public function setFormat($format)
    {
        if (!in_array($format, $this->formats)) {
            $msg = "The '%s' format is not allowed. Try with '%s'";
            throw new InvalidArgumentException(sprintf($msg, $format, implode("', '", $this->formats)));
        }

        $this->format = $format;

        return $this;
    }
public function setFormat ( $ format ) { if ( ! in_array ( $ format , $ this -> formats ) ) { $ msg = "The '%s' format is not allowed. Try with '%s'" ; throw new InvalidArgumentException ( sprintf ( $ msg , $ format , implode ( "', '" , $ this -> formats ) ) ) ; } $ this -> format = $ format ; return $ this ; }
Set request format.

@param string $format

@return GetAjaxEvent

@throws InvalidArgumentException When the format is not allowed
Set request format .