Create the encoded string
@param Image $Object
@param Data $Values
@param array $Format
5368
public function drawSplitPath(Image $Object, Data $Values, array $Format = [])
    {
        $this->pChartObject = $Object;

        $Spacing = isset($Format["Spacing"]) ? $Format["Spacing"] : 20;
        $TextPadding = isset($Format["TextPadding"]) ? $Format["TextPadding"] : 2;
        $TextPos = isset($Format["TextPos"]) ? $Format["TextPos"] : TEXT_POS_TOP;
        $Surrounding = isset($Format["Surrounding"]) ? $Format["Surrounding"] : null;
        $Force = isset($Format["Force"]) ? $Format["Force"] : 70;
        $Segments = isset($Format["Segments"]) ? $Format["Segments"] : 15;
        $X1 = $Object->GraphAreaX1;
        $Y1 = $Object->GraphAreaY1;
        $X2 = $Object->GraphAreaX2;
        $Y2 = $Object->GraphAreaY2;

        /* Data Processing */
        $Data = $Values->getData();
        $Palette = $Values->getPalette();

        $LabelSerie = $Data["Abscissa"];
        $DataSerie = [];

        foreach ($Data["Series"] as $SerieName => $Value) {
            if ($SerieName != $LabelSerie && empty($DataSerie)) {
                $DataSerie = $SerieName;
            }
        }

        $DataSerieSum = array_sum($Data["Series"][$DataSerie]["Data"]);
        $DataSerieCount = count($Data["Series"][$DataSerie]["Data"]);

        /* Scale Processing */
        if ($TextPos == TEXT_POS_RIGHT) {
            $YScale = (($Y2 - $Y1) - (($DataSerieCount + 1) * $Spacing)) / $DataSerieSum;
        } else {
            $YScale = (($Y2 - $Y1) - ($DataSerieCount * $Spacing)) / $DataSerieSum;
        }
        $LeftHeight = $DataSerieSum * $YScale;

        /* Re-compute graph width depending of the text mode choosen */
        if ($TextPos == TEXT_POS_RIGHT) {
            $MaxWidth = 0;
            foreach ($Data["Series"][$LabelSerie]["Data"] as $Key => $Label) {
                $Boundardies = $Object->getTextBox(0, 0, $Object->FontName, $Object->FontSize, 0, $Label);
                if ($Boundardies[1]["X"] > $MaxWidth) {
                    $MaxWidth = $Boundardies[1]["X"] + $TextPadding * 2;
                }
            }
            $X2 = $X2 - $MaxWidth;
        }

        /* Drawing */
        $LeftY = ((($Y2 - $Y1) / 2) + $Y1) - ($LeftHeight / 2);
        $RightY = $Y1;

        foreach ($Data["Series"][$DataSerie]["Data"] as $Key => $Value) {
            if (isset($Data["Series"][$LabelSerie]["Data"][$Key])) {
                $Label = $Data["Series"][$LabelSerie]["Data"][$Key];
            } else {
                $Label = "-";
            }
            $LeftY1 = $LeftY;
            $LeftY2 = $LeftY + $Value * $YScale;

            $RightY1 = $RightY + $Spacing;
            $RightY2 = $RightY + $Spacing + $Value * $YScale;

            $Settings = [
                "R" => $Palette[$Key]["R"],
                "G" => $Palette[$Key]["G"],
                "B" => $Palette[$Key]["B"],
                "Alpha" => $Palette[$Key]["Alpha"],
                "NoDraw" => true,
                "Segments" => $Segments,
                "Surrounding" => $Surrounding
            ];


            $Angle = $Object->getAngle($X2, $RightY1, $X1, $LeftY1);
            $VectorX1 = cos(deg2rad($Angle + 90)) * $Force + ($X2 - $X1) / 2 + $X1;
            $VectorY1 = sin(deg2rad($Angle + 90)) * $Force + ($RightY1 - $LeftY1) / 2 + $LeftY1;
            $VectorX2 = cos(deg2rad($Angle - 90)) * $Force + ($X2 - $X1) / 2 + $X1;
            $VectorY2 = sin(deg2rad($Angle - 90)) * $Force + ($RightY1 - $LeftY1) / 2 + $LeftY1;

            $Points = $Object->drawBezier(
                $X1,
                $LeftY1,
                $X2,
                $RightY1,
                $VectorX1,
                $VectorY1,
                $VectorX2,
                $VectorY2,
                $Settings
            );

            $PolyGon = [];
            foreach ($Points as $Key => $Pos) {
                $PolyGon[] = $Pos["X"];
                $PolyGon[] = $Pos["Y"];
            }

            $Angle = $Object->getAngle($X2, $RightY2, $X1, $LeftY2);
            $VectorX1 = cos(deg2rad($Angle + 90)) * $Force + ($X2 - $X1) / 2 + $X1;
            $VectorY1 = sin(deg2rad($Angle + 90)) * $Force + ($RightY2 - $LeftY2) / 2 + $LeftY2;
            $VectorX2 = cos(deg2rad($Angle - 90)) * $Force + ($X2 - $X1) / 2 + $X1;
            $VectorY2 = sin(deg2rad($Angle - 90)) * $Force + ($RightY2 - $LeftY2) / 2 + $LeftY2;

            $Points = $Object->drawBezier(
                $X1,
                $LeftY2,
                $X2,
                $RightY2,
                $VectorX1,
                $VectorY1,
                $VectorX2,
                $VectorY2,
                $Settings
            );
            $Points = array_reverse($Points);
            foreach ($Points as $Key => $Pos) {
                $PolyGon[] = $Pos["X"];
                $PolyGon[] = $Pos["Y"];
            }

            $Object->drawPolygon($PolyGon, $Settings);

            if ($TextPos == TEXT_POS_RIGHT) {
                $Object->drawText(
                    $X2 + $TextPadding,
                    ($RightY2 - $RightY1) / 2 + $RightY1,
                    $Label,
                    ["Align" => TEXT_ALIGN_MIDDLELEFT]
                );
            } else {
                $Object->drawText(
                    $X2,
                    $RightY1 - $TextPadding,
                    $Label,
                    ["Align" => TEXT_ALIGN_BOTTOMRIGHT]
                );
            }
            $LeftY = $LeftY2;
            $RightY = $RightY2;
        }
    }
558767
public function encode($data, $format, array $context = array())
    {
        if ($this->native) {
            return yaml_emit($data, YAML_UTF8_ENCODING, YAML_LN_BREAK);
        }

        return $this->encoder->dump($data);
    }
261818
private function parseDates($data, $format)
    {
        foreach ($data as $key => $entry) {
            $data[$key]['date'] = $data[$key]['date']->format($format);
        }

        return $data;
    }
1028803
public function setFormat($format)
    {
        if (!in_array($format, self::$formats)) {
            throw new ImageException('Invalid image format provided. Supported formats are [jpg, jpeg, png, gif].');
        }

        $this->format = $format;
    }
871100
public static function encode( $data, $format )
    {
        if(!in_array($format, self::$supported)) return null;
        $formatter = self::$formatMap[$format];
        return forward_static_call(array($formatter, 'encode'), $data);
    }
466522
protected function applyCustomFormat($format, $data)
    {
        $aClassFunc = $this->getFuncParams($format);

        $params = array_key_exists(
            'params',
            $format
        ) ? $format['params'] : [];

        array_unshift($params, $data);

        $object = (new \ReflectionClass($aClassFunc['class']))->newInstance();

        $data = call_user_func_array([$object, $aClassFunc['method']], $params);

        return $data;
    }
1074334
public function jsonEncode(AbstractClassContent $content, $format = AbstractClassContent::JSON_DEFAULT_FORMAT)
    {
        if (AbstractClassContent::JSON_DEFINITION_FORMAT === $format) {
            $classname = get_class($content);
            $content = new $classname;
        }

        $result = $content->jsonSerialize($format);

        if (isset($result['image']) && null !== $this->iconizer) {
            $result['image'] = $this->iconizer->getIcon($content);
        }

        return $result;
    }
960770
public function setData($data, $format = 'dmY')
    {
        $this->data = trim($data, '0 ') ? Carbon::createFromFormat($format, $data) : null;

        return $this;
    }
459612
public function loadString($data, $format='Json', array $options=[])
  {
    $handler = Format::getInstance($format);
    
    $obj = $handler->stringToObject($data, $options);
    $this->loadObject($obj);

    return true;
  }
680946
static function setProperties( ValueObjectInterface $object, array $values )
    {
        foreach ( $values as $property => $value )
        {
            $this->setProperty( $object, $property, $value );
        }
    }
595646
public function setOutputFormat($format = null, $quality = null, $filters = null) {

		if ($format) {
			$format = strtolower($format);

			if (in_array($format, static::$_allowed_formates)) {
				$this->_output_format = $format;

				# fix file extension if this method was called after calling setSaveOptions Method
				if ($this->_save_path) {
					$this->_save_name = preg_replace(
						'/(?<=\.)(?:png|jpeg|jpg|gif)$/i',
						$this->_output_format,
						$this->_save_name
					);

					$this->_save_path = $this->_save_dir . DIRECTORY_SEPARATOR . $this->_save_name;
				}
			}
		}

		// Quality
		$this->_output_options = [];
		if (is_numeric($quality)) {
			// if($format == 'jpg' || $format == 'jpeg')
			// {
			// 	if($quality < 0 || $quality > 100)
			// 		throw new ImageException(__METHOD__ . ' ' . $format . ' quality must be between 0-100');
			// }
			// else if($format == 'png')
			// {
			// 	if($quality < 0 || $quality > 9)
			// 		throw new ImageException(__METHOD__ . ' ' . $format . ' quality must be between 0-9');
			// }

			if ($this->_output_format == 'jpg' || $this->_output_format == 'jpeg') {
				$quality = round($quality * 100 / 100);
			} else if ($this->_output_format == 'png') {
				$quality = round($quality * 9 / 100);
			}

			$this->_output_options[] = $quality;
		}

		// Filters
		if ($filters !== null) {
			// Filters must come after quality
			if (empty($this->_output_options)) {
				$this->_output_options[] = null;
			}

			$this->_output_options[] = $filters;
		}

		return $this;
	}
261646
public function write( $value, $format = FALSE )
	{
		if( $format )
		{
			if( version_compare( phpversion(), '5.4.0' ) >= 0 )
				$json	= json_encode( $value, JSON_PRETTY_PRINT );
			else
				$json	= ADT_JSON_Formater::format( json_encode( $value ) );
		}
		else
			$json	= json_encode( $value );
		return FS_File_Writer::save( $this->filePath, $json );
	}
763814
public function normalize($object, $format = null, array $context = [])
    {
        /** @var object $normalized */
        $normalized = parent::normalize($object, $format, $context);
        $normalized->developer->isCompany = true;

        return $normalized;
    }
888344
private function decodeByProperty($property, $format)
    {
        return array_map(function ($entry) use ($property) {
            \PHPUnit_Framework_Assert::assertInternalType('array', $entry);
            \PHPUnit_Framework_Assert::assertArrayHasKey($property, $entry);

            return $entry[$property];
        }, $this->decode($format));
    }
591116
public function normalize($object, $format = null, array $context = array())
    {
        $context['depth'] = isset($context['depth']) ? $context['depth']+1 : 0;

        if (!isset($context['@references'])) {
            $references = array();
            $context['@references'] = &$references;
        }

        if (!isset($context['cache_key'])) {
            $context['cache_key'] = md5(serialize($context));
        }

        $class = get_class($object);

        /* @var ClassMetadata $meta */
        $context['entityMeta'] = $this->entityMetadataFactory->getMetadataFor($class);

        $data = array();
        $attributes = $this->getAttributes($object, $format, $context);
        foreach ($attributes as $attribute) {
            $value = $this->getAttributeValue($object, $attribute, $format, $context);

            $data[$attribute] = $this->normalizeProperty($value, $attribute, $format, $context);
        }

        $hint = $this->getHintFromObject($object);


        if ($context['depth'] === 0 and !empty($context['@references'])) {
            $ids = $this->getIdentifierFromObject($object);
            $id = $this->getIdentifiersAsString($ids);
            $objectId = current($hint).'#'.$id;

            unset($context['@references'][$objectId]);

            ksort($context['@references']);
            $data['@references'] = array_filter($context['@references']);
        }

        return array_merge($hint, $data);
    }
465325
static public function valueFormatter(RecordValue $valueContainer, $format) {
        /** @var FileColumn $column */
        $column = $valueContainer->getColumn();
        if ($format === 'file_info') {
            // colname_as_file_info
            // returns FileInfo[] or null
            return $valueContainer->getCustomInfo(
                'file_info',
                function () use ($valueContainer, $format, $column) {
                    // return FileInfo object or array of FileInfo objects by image config name provided via $format
                    $record = $valueContainer->getRecord();
                    $value = $record->getValue($column->getName(), 'array');
                    $fileConfig = $column->getConfiguration();
                    if (!empty($value) && is_array($value) && static::isFileInfoArray($value)) {
                        $imageInfo = FileInfo::fromArray($value, $fileConfig, $record);
                        if ($imageInfo->exists()) {
                            return $imageInfo;
                        }
                    }
                    return null;
                },
                true
            );
        } else if (in_array($format, ['url', 'url_with_timestamp', 'path'], true)) {
            // colname_as_url / colname_as_url_with_timestamp / colname_as_path
            // returns string or null
            return $valueContainer->getCustomInfo(
                'format:' . $format,
                function () use ($valueContainer, $format, $column) {
                    $fileInfo = parent::valueFormatter($valueContainer, 'array');
                    if (is_array($fileInfo) && static::isFileInfoArray($fileInfo)) {
                        $fileConfig = $column->getConfiguration();
                        $fileInfo = FileInfo::fromArray($fileInfo, $fileConfig, $valueContainer->getRecord());
                        if ($fileInfo->exists()) {
                            if ($format === 'path') {
                                return $fileInfo->getAbsoluteFilePath();
                            } else {
                                $url = $fileInfo->getAbsoluteUrl();
                                if ($format === 'url_with_timestamp') {
                                    $url .= '?_' . time();
                                }
                                return $url;
                            }
                        }
                    }
                    return null;
                },
                true
            );
        } else {
            return parent::valueFormatter($valueContainer, $format);
        }
    }
70393
public function encode($data, $format, array $context = [])
    {
        return $this->yamlEncode->encode($data, $format, $context);
    }