This method will lighten provided data into requested format, if format is equal to 0 this method
won't transform anything.

@param array   $data
@param integer $format

@return array
975309
private function formatJsonData(array $data, $format)
    {
        if (self::JSON_DEFINITION_FORMAT === $format || self::JSON_CONCISE_FORMAT === $format) {
            unset($data['state'], $data['created'], $data['modified'], $data['revision']);
        }

        if (self::JSON_INFO_FORMAT === $format || self::JSON_CONCISE_FORMAT === $format) {
            unset($data['accept'], $data['label'], $data['minentry'], $data['maxentry']);
        }

        if (self::JSON_DEFINITION_FORMAT === $format || self::JSON_INFO_FORMAT === $format) {
            unset($data['elements'], $data['extra']);
        }

        if (self::JSON_DEFINITION_FORMAT === $format) {
            unset($data['uid']);
        } elseif (self::JSON_INFO_FORMAT === $format) {
            unset($data['parameters']);
        }

        return $data;
    }
971349
public static function importArray(array $data, $format = 'atom')
    {
        $obj = 'Zend_Feed_' . ucfirst(strtolower($format));
        /**
         * @see Zend_Loader
         */
        require_once 'Zend/Loader.php';
        Zend_Loader::loadClass($obj);
        /**
         * @see Zend_Feed_Builder
         */
        require_once 'Zend/Feed/Builder.php';
        return new $obj(null, null, new Zend_Feed_Builder($data));
    }
1374908
public function jsonSerialize($format = self::JSON_DEFAULT_FORMAT)
    {
        $data = [
            'uid'        => $this->_uid,
            'label'      => $this->_label,
            'type'       => $this->getContentType(),
            'state'      => $this->_state,
            'created'    => $this->_created->getTimestamp(),
            'modified'   => $this->_modified->getTimestamp(),
            'revision'   => $this->_revision,
            'parameters' => $this->getAllParams(),
            'accept'     => array_map(
                function ($classname) {
                    return str_replace(NAMESPACE_SEPARATOR, '/', $classname);
                },
                self::getShortClassname($this->getAccept())
            ),
            'minentry'   => $this->getMinEntry(),
            'maxentry'   => $this->getMaxEntry(),
            'elements'   => $this->computeElementsToJson($this->getData()),
            'has_elements' => count($this->getData()) === 0 ? false : true,
            'extra'      => [],
        ];

        if (0 === count($data['parameters'])) {
            $data['parameters'] = new \ArrayObject();
        }

        return $this->formatJsonData($data, $format);
    }
565041
public function getTransformedData($data): array
    {
        if (method_exists($this, 'transform')) {
            // Transformer provides a 'transform' method
            return (array) $this->transform($data);
        }

        // Otherwise, use the withProps method which calls getProps()
        return $this->withProps($data, $this->getProps());
    }
571448
public function format($message, array $format)
    {
        $replace = [
            ':message' => $message,
            ':code' => $this->getStatusCode(),
        ];

        array_walk_recursive($format, function (&$value, $key) use ($replace) {
            if (isset($replace[$value])) {
                $value = $replace[$value];
            }
        });

        return $format;
    }
99794
protected function parse_format($format) {
		$format = parent::parse_format($format);
		return str_replace(array_keys(static::$days), static::$days, $format);
	}
76974
public function getMetaDateFormatted($format = null)
    {
        if ($this->owner->hasMetaDate()) {
            return $this->owner->getMetaDate()->Format($format ? $format : $this->owner->getMetaDateFormat());
        }
    }
950625
public function parseCustomFormat($format)
    {
        if (isset($this->parsedFormats[$format])) {
            return $this->parsedFormats[$format];
        }

        return $this->parsedFormats[$format] = $this->parseFormat($format);
    }
299595
public function setFormat($format) {
        if ($format === null) {
            $format = [];
        } else if ( ! is_array($format)) {
            $format = [$format];
        }

        $this->format = $format;

        return $this;
    }
1149769
public function serialize($data, $format, array $context = array())
    {
        if (!isset($this->handlers[$format])) {
            throw new \BadMethodCallException(sprintf(
                'Unsupported format "%s", only [%s] are',
                $format, implode(', ', array_keys($this->handlers))
            ));
        }

        return $this->handlers[$format]->serialize(
            $data,
            empty($context['scope']) ? 'default' : $context['scope']
        );
    }
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;
    }
148645
public static function toSql(string $format, $data = null)
    {
        if ($data === null) {
            return null;
        }

        switch ($format) {
            case self::NONE:
                return $data;
            case self::TIME:
            case self::TIMEU:
            case self::TIMETZ:
            case self::TIMEUTZ:
            case self::DATE:
            case self::DATETIME:
            case self::DATETIMEU:
            case self::DATETIMETZ:
            case self::DATETIMEUTZ:
            case self::TIMESTAMP:
                if (empty($data)) {
                    $result = null;
                } elseif (!is_object($data)) {
                    $datetime = new DateTime($data);
                    $result = $datetime->format($format);
                } elseif ($data instanceof DateTime) {
                    $result = $data->format($format);
                } else {
                    throw new FormatException('Unknown datetime object: ' . get_class($data));
                }

                return $result;
            case self::INT:
                return (integer)$data;
            case self::BOOL:
                return (integer)$data;
            case self::FLOAT:
                if (strpos($data, ',') > strpos($data, '.')) {
                    $data = str_replace(array('.', ','), array('', '.'), $data);
                } elseif(strpos($data, '.') > strpos($data, ',')) {
                    $data = str_replace(',', '', $data);
                }

                return floatval($data);
            case self::STRING:
                return (string)$data;
            case self::ALPHANUMERIC:
                return preg_replace('/[^a-zA-Z0-9_ ]/', '', $data);
            case self::SERIALIZED:
                return serialize($data);
            case self::JSON:
                return json_encode($data);
            case self::CSV:
                return implode(',', $data);
            default:
                throw new FormatException ('Unknown format: ' . $format);
        }
    }
1070663
protected function transform($messages, $format)
        {
            $messages = (array) $messages;

            foreach ($messages as $key => &$message) {
                $message = repl(':message', $message, $format);
            }

            return $messages;
        }
921957
protected function unformatPayloadData(array $data)
    {
        $unformattedData = array();

        foreach ($data as $key => $value) {
            $newKey = $this->deserializeColumnName($key);

            if (is_array($value)) {
                $newValue = $this->unformatPayloadData($value);
            } else {
                $newValue = $value;
            }

            $unformattedData[$newKey] = $newValue;
        }

        return $unformattedData;
    }
1001274
public function getUpdatedAt($format = 'Y-m-d H:i:s')
    {
        if ($this->updatedAt instanceof \DateTime && $format !== null) {
            return $this->updatedAt->format($format);
        }

        return $this->updatedAt;
    }
148574
public function decode($data, $format, array $context = array())
    {
        if ($this->native) {
            return yaml_parse($data);
        }

        return $this->decoder->parse($data);
    }
166208
public function normalizeFormData(array $data)
    {
        if (empty($data)) {
            return $data;
        }

        $renameMap = array_flip($this->renamemap);

        foreach ($renameMap as $customName => $defaultName) {
            if (array_key_exists($customName, $data)) {
                $value = $data[$customName];
                unset($data[$customName]);
                $data[$defaultName] = $value;
            }
        }

        return $data;
    }