Format a list of data for the export.

@param string $format  - The mime type we want to change the data into
@param array  $data    - The data to format
@param array  $options - A list of options

@return mixed
168870
public function format($format, array $data, $options)
    {
        $adapter = $this->getAdapter($format);

        return $adapter->format($data, $options);
    }
347423
protected function prepareResult(&$data, array $options)
    {
        if (!empty($options['unserialize']) && !empty($data)) {
            foreach ((array) $options['unserialize'] as $field) {
                $data[$field] = empty($data[$field]) ? array() : unserialize($data[$field]);
            }
        }
    }
470372
public function thumbnail($media, $format, $options = [])
    {
        return $this->getTwigExtension()->thumbnail($media, $format, $options);
    }
304998
public function to($format, array $options = []) {
		$default = ['indexed' => true];
		$options += $default;
		$options['internal'] = !$options['indexed'];
		unset($options['indexed']);

		$this->offsetGet(null);
		if (!$options['internal'] && !is_scalar(current($this->_index))) {
			$options['internal'] = true;
		}
		return parent::to($format, $options);
	}
148574
public function decode($data, $format, array $context = array())
    {
        if ($this->native) {
            return yaml_parse($data);
        }

        return $this->decoder->parse($data);
    }
1296812
public function setFormat($format) {

        $this->checkInArray($format, GDAXConstants::$reportFormatValues);
        $this->format = $format;
        return $this;

    }
1009499
public function find($options=null, $format=false)
    {
        if (isset($options)) {
            if (is_numeric($options)) {
                return $this->findById($options);
            } else {
                $this->getQuery()->set($this->formatQueryOptions($options));
            }
        }
        
        $model = static::getQueryModel();
        
        $this->getQuery()->type('select')->set('limit', 1);
        
        $data = $this->query();
        
        if ($data && count($data) > 0) {
            $data = $data[0];
            if ($format) {
                $data = static::formatOutput($data, $model);
            }
        } else {
            $data = null;
        }
        
        return $data;
    }
482339
protected function createFromArrayWithContext($data, $options)
    {
        $_documentClass = $this->_documentClass;

        return $_documentClass::createFromArray($data, $options);
    }
19951
public function format($format = null)
    {
        if (func_num_args()) {
            return parent::format($format);
        }
        if ($this->_format === null) {
            $this->negotiate();
        }
        return $this->_format;
    }
1224666
public function format($data, $multiple = false)
    {
        if ($multiple === true || $data instanceof Collection) {
            foreach ($data as $key => $value) {
                $data[$key] = $this->runFormatters($value);
            }
        } else {
            $data = $this->runFormatters($data);
        }

        return $data;
    }
138104
private function formatMessage($format, $context = []) {
        $format = $this->translate($format);

        $msg = preg_replace_callback('`({[^{}]+})`', function ($m) use ($context) {
            $args = array_filter(array_map('trim', explode(',', trim($m[1], '{}'))));
            $field = array_shift($args);

            switch ($field) {
                case 'value':
                    return $this->formatValue($context[$field] ?? null);
                case 'field':
                    $field = $context['field'] ?: 'value';
                    return $this->formatFieldName($field);
                default:
                    return $this->formatField(isset($context[$field]) ? $context[$field] : null, $args);
            }
        }, $format);
        return $msg;
    }
1368350
public static function format($query, array $options = [])
    {
        $lexer = new Lexer($query);
        $formatter = new self($options);

        return $formatter->formatList($lexer->list);
    }
356733
public function toString($format = 'json', $options = array())
	{
		return $this->processor($format)->objectToString($this->data, $options);
	}
541198
public function media($media, $format, $options = [])
    {
        $media = $this->getMedia($media);

        if (null === $media) {
            return '';
        }

        $provider = $this
            ->getMediaService()
            ->getProvider($media->getProviderName());

        $format = $provider->getFormatName($media, $format);

        $options = $provider->getHelperProperties($media, $format, $options);

        return $this->render($provider->getTemplate('helper_view'), [
            'media' => $media,
            'format' => $format,
            'options' => $options,
        ]);
    }
1102906
protected static function format(array $data, $format)
    {
        $format = strtolower($format);
        switch ($format) {
            case static::CONTENT_TYPE_FORM:
                return http_build_query($data);
            case static::CONTENT_TYPE_JSON:
                return json_encode($data);
            default:
                throw new InvalidArgumentException('Format not supported');
        }
    }
953193
public function to($format, array $options = []) {
		switch ($format) {
			case 'array':
				$array = [];
				$class = new ReflectionClass(get_class($this));

				foreach ($class->getProperties(ReflectionProperty::IS_PUBLIC) as $prop) {
					$array[$prop->getName()] = $prop->getValue($this);
				}
				return $array;
			case 'url':
				$host = $this->host . ($this->port ? ":{$this->port}" : '');
				return "{$this->scheme}://{$host}{$this->path}";
			case 'context':
				$defaults = ['content' => $this->body(), 'ignore_errors' => true];
				return [$this->scheme => $options + $defaults];
			case 'string':
			default:
				return (string) $this;
		}
	}
574909
protected function applyFormat($format, $data)
    {

        foreach ($format as $key => $value) {
            $meta = array_values(array_filter($this->formatting, function ($item) use ($value) {
                return $item['name'] === $value['function'] ? true : false;
            }));

            if ($meta && !array_key_exists('class', $value)) {
                $data = $this->applyDefaultFormat($value, $meta[0], $data);
            } else {
                $data = $this->applyCustomFormat($value, $data);
            }
        }

        return $data;
    }