Set communication format.
One of html|xml|json|csv|dbf|xls|isdoc|isdocx|edi|pdf|pdf|vcf|ical

@param string $format

@return boolean format is availble
962685
public function setFormat($format)
    {
        $result = true;
        if (($this->debug === true) && !empty($this->evidence) && isset(Formats::$$this->evidence)) {
            if (array_key_exists($format, array_flip(Formats::$$this->evidence))
                === false) {
                $result = false;
            }
        }
        if ($result === true) {
            $this->format = $format;
            $this->updateApiURL();
        }
        return $result;
    }
905167
public function getDateTimeFormat(string $format='Y-m-d H:i:s')
    {
        $this->setDateTimeZone()->setDateTime();

        return $this->dateTime->format($format);
    }
1095463
public function setFormat($format = false)
    {
        if(!$format)
        {
            $format = \Ginger\System\Parameters::$format;
        }
        $this->format   = $format;

        if(!isset($this->allowedFormats[$this->format]))
        {
            $this->format = $this->defaultFormat;
        }
    }
299595
public function setFormat($format) {
        if ($format === null) {
            $format = [];
        } else if ( ! is_array($format)) {
            $format = [$format];
        }

        $this->format = $format;

        return $this;
    }
311726
public function setEmailFormat($format)
    {
        if (!in_array($format, $this->_emailFormatAvailable)) {
            throw new InvalidArgumentException('Format not available.');
        }
        $this->_emailFormat = $format;

        return $this;
    }
1102112
public function setDefaultFormat($format)
    {
        foreach (parent::all() as $route) {
            // Set default format only if not set already (could be defined in annotation)
            if (!$route->getDefault('_format')) {
                $route->setDefault('_format', $format);
            }
        }
    }
513268
public function format($format)
    {
        if (!$this->image) {
            $this->image();
        }

        $this->format = $format;

        return $this;
    }
812679
public function setFormat($format)
    {
        if (empty($format) || !is_string($format)) {

            throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
        }

        if ($format[0] !== '/') {
            $format = '/^' . $format;
        }

        if ($format[strlen($format) - 1] !== '/') {
            $format .= '$/';
        }

        $this->_format = $format;
        return $this;
    }
1135103
public function setFormat($format)
    {
        if (!\in_array($format, ['int32', 'int64', 'int', 'long', 'float', 'double', 'int16', 'int8'], true)) {
            throw new \Exception(\sprintf('Incorrect format given: "%s"', $format));
        }
        $this->format = $format;

        return $this;
    }
462831
public function format($format = null)
    {
        if (!$format) {
            $format = $this->getFormat();
        }

        return parent::format($format ?: static::$toStringFormat);
    }
889931
public function setFormat($format)
    {
        if ($this->app['debug']) {
            if (false === is_string($format)) {
                throw new \InvalidArgumentException(sprintf('Format must be a string, got "%s".', is_object($format) ? get_class($format) : gettype($format)));
            }

            if (false === strpos($format, '%key%')) {
                throw new \InvalidArgumentException(sprintf('Format must contain "%%key%%", got "%s".', $format));
            }

            if (false === strrpos($format, '.')) {
                throw new \InvalidArgumentException(sprintf('Format missing extension, got "%s".', $format));
            }
        }

        $this->format = $format;

        if (strlen($format) > 5 && '.dist' === substr($format, -5)) {
            $format = substr($format, strrpos($format, '.', -6) + 1);
        } else {
            $format = substr($format, strrpos($format, '.') + 1);
        }

        switch ($format) {
            case 'json':
            case 'json.dist':
                $this->loader = new JsonLoader();
                break;
            case 'yml':
            case 'yml.dist':
            case 'yaml':
            case 'yaml.dist':
                if (false === class_exists('Symfony\\Component\\Yaml\\Yaml')) {
                    throw new \RuntimeException('Missing Symfony Yaml component.');
                }

                $this->loader = new YamlLoader();
                break;
            case 'php':
            case 'php.dist':
                $this->loader = new PHPLoader();
                break;
            default:
                throw new \InvalidArgumentException(sprintf('Unsupported file format "%s".', $format));
        }

        $this->flushAll();

        return $this;
    }
1350928
public function setFormat($format)
    {
        if($format)
        {
            if(!isset(static::$_formats[$format])) {
                throw new UnexpectedValueException('Unregistered format: "' . $format . '" given.');
            }

            $this->setContentType(static::$_formats[$format][0]);
        }

        return $this;
    }
1158991
public function setFormat($format)
    {
        if (JFactory::getApplication()->getCfg('sef_suffix') && $format === 'feed') {
            $format = 'rss';
        }

        return parent::setFormat($format);
    }
453224
public function setApiQueryStringRequestFormat($format)
    {
        $this->apiQueryStringRequestFormat = $format;
        return $this->apiQueryStringRequestFormat === $format ? true : false;
    }
1110673
public function setFormat($name, FormatInterface $format)
    {
        // If name is int or null, get name from Format object.
        $name = (is_numeric($name) || !$name) ? $format->getName() : $name;

        $this->formats[$name] = $format;

        return $this;
    }
505609
public function setFormats($formats)
    {
        if (is_array($formats)) {
            $formats = json_encode($formats);
        }

        $this->formats = $formats;

        return $this;
    }
1201140
public function setJsonFormat($format) {
        if (!is_string($format)) throw new \Exception("JsonFormat must be a valid json string or a path to a file");

        if (file_exists($format)) {
            $handler = fopen($format, 'r');
            $contents = fread($handler, filesize($format));
            fclose($handler);

            $format = $contents;
        }
        $format = trim($format);

        $arrayFormatCandidate = json_decode($format, true, 1024);

        $error = json_last_error();
        if ($error === JSON_ERROR_NONE) {
            $this->setFormat($arrayFormatCandidate);
            return true;
        }

        throw new \Exception("Invalid Json format or file");
    }