Initialize JSON structure.

@return Path

@deprecated
938
public function initializeStructure()
    {
        $structure = [
            'id' => $this->getId(),
            'name' => $this->getName(),
            'description' => $this->getDescription(),
            'manualProgressionAllowed' => $this->manualProgressionAllowed,
            'steps' => [],
        ];

        $this->setStructure(json_encode($structure));

        return $this;
    }
1189206
public function jsonSerialize()
    {
        $position = [$this->getLng(), $this->getLat()];
        if($this->is3d()) $position[] = $this->getAlt();
        return new \GeoJson\Geometry\Point($position);
    }
354445
public function jsonSerialize()
    {
        return array(
            self::METADATA_SOURCE   => $this->metadataSource,
            self::TEMPLATE_VARIABLE => $this->templateVariable,
            self::FILES             => $this->getFiles(),
            self::DIRECTORIES       => $this->directories,
            self::NAME              => $this->name,
            self::ENVIRONNEMENT     => $this->environnement,
            self::DEPENDENCIES      => $this->dependencies,
            self::DTO               => $this->dto,
        );
    }
1339844
public function jsonSerialize() {
        $ret = parent::jsonSerialize();
        $ret->id = $this->id;
        $ret->logicalConnectorWithNext = $this->logicalConnectorWithNext;
        $ret->negation = $this->negation;
        $ret->groupedWith = $this->groupedWith;

        return $ret;
    }
468672
final protected function initialJSON()
    {
        $file = json_decode(file_get_contents(FEnvFcm::get("framework.config.core.config.file")));
        if (isset($file->installation) && $file->installation == null) {
            $file->installation = new \DateTime();
            $file->default_env =  "dev";
            $file->location = realpath(__DIR__."../../../../../../../../").DIRECTORY_SEPARATOR;
            $result = json_encode($file, JSON_PRETTY_PRINT);
            file_put_contents(FEnvFcm::get("framework.config.core.config.file"), $result);
        }
    }
970022
public function jsonSerialize() {
		return [
			self::JSON_KEY_GET          => $this->get,
			self::JSON_KEY_POST         => $this->post,
			self::JSON_KEY_FILES        => $this->files,
			self::JSON_KEY_COOKIE       => $this->cookie,
			self::JSON_KEY_HEADERS      => $this->HEADERS,
			self::JSON_KEY_METHOD       => $this->getRequestMethod(),
			self::JSON_KEY_INPUT        => $this->INPUT,
			self::JSON_KEY_PARSED_INPUT => $this->PARSED_INPUT,
			self::JSON_KEY_REQUEST_URI  => $this->getRequestUri(),

			self::JSON_KEY_PARSED_REQUEST_URI => $this->parsedUri,
		];
	}
1166131
public function jsonSerialize() {
    $valid = (!isset($this->backgroundColor) ||
        $this->validateBackgroundColor($this->backgroundColor)) &&
      (!isset($this->opacity) ||
        $this->validateOpacity($this->opacity));
    if (!$valid) {
      return NULL;
    }
    return parent::jsonSerialize();
  }
300749
protected function formatJSON()
    {
        $result = new \stdClass();

        if ($this->outputMode == self::MODE_ERROR) {
            $this->formatFailure($result);
        } else {
            $this->formatSuccess($result);
        }

        // include valid, plain non-namespace data
        foreach ($this->plain as $key => $value) {
            $result->$key = $value;
        }
        //TODO: better handling of links (self, related, pagination) http://jsonapi.org/format/#document-links

        if ($this->meta) {
            $result->meta = $this->meta;
        }

        return $result;
    }
232311
public function jsonSerialize()
    {
        $o = [];
        foreach ($this->properties as $prop) {
            $value = $this->$prop;
            if (is_null($value)) {
                $o[$prop] = $value;
            } elseif (is_array($value)) {
                $t = [];
                foreach ($value as $k => $v) {
                    if (is_object($v)) {
                        $t[$k] = $v->jsonSerialize();
                    } else {
                        $t[$k] = (string) $v;
                    }
                }
                $o[$prop] = $t;
            } elseif (is_object($value)) {
                $o[$prop] = $value->jsonSerialize();
            } else {
                $o[$prop] = $value;
            }
        }
        return $o;
    }
127704
public function jsonSerialize()
    {
        $geometries = [];
        foreach ($this->geometries as $geometry) {
            $geometries[] = $geometry->jsonSerialize();
        }

        return new \GeoJson\Geometry\GeometryCollection($geometries);
    }
6155
protected function buildJSON()
    {
        $json = $this->parent->createFileJson($this->file);
        $json['created'] = $this->file->obj('Created')->FormatFromSettings();
        $json['lastEdited'] = $this->file->obj('LastEdited')->FormatFromSettings();
        $json['url'] = $this->file->getAbsoluteURL();

        $json['size'] = $this->file->getSize();
        $json['folder'] = $this->file->Parent()->Filename;

        if ($this->file instanceof Image) {
            $preview = $this->file->Fill(400, 133);
            $detail = $this->file->getKickAssetsDetailImage();
            $json['previewImage'] = $preview ? $preview->URL : $this->file->getPreviewThumbnail(128, 128)->URL;
            $json['detailImage'] = $detail ? $detail->URL : $this->file->getPreviewThumbnail(128, 128)->URL;
        }

        return $json;
    }
9830
public function to_json() {
		parent::to_json();

		// We need to make sure we have the correct image URL.
		foreach ( $this->choices as $value => $args ) {
			$this->choices[ $value ]['url'] = esc_url( sprintf( $args['url'], get_template_directory_uri(), get_stylesheet_directory_uri() ) );
		}
		$this->json['choices'] = $this->choices;
		$this->json['link']    = $this->get_link();
		$this->json['value']   = $this->value();
		$this->json['id']      = $this->id;
	}
413486
public function jsonSerialize()
    {
        $properties = get_object_vars($this);
        $outProperties = array();
        foreach ($properties as $propertie => $value) {
            if ($propertie[0] === '_') {
                $namePropertie = substr($propertie, 1);
                $outProperties[$namePropertie] = $this->$propertie;
            } else {
                $outProperties[$propertie] = $this->$propertie;
            }
        }

        return $outProperties;
    }
895704
public function jsonSerialize()
    {
        $jsonArray = [
            "error" => [
                "message" => $this->getMessage(),
                "code" => $this->getCode()
            ]
        ];

        if (isset($this->details)) {
            $jsonArray["error"]["details"] = $this->details;
        }

        if (isset($this->innerError)) {
            $jsonArray["error"]["innererror"] = [
                "code" => $this->innerError
            ];
        }

        return $jsonArray;
    }
1302246
public function jsonSerialize()
    {
        $r = [
            'message' => $this->getMessage(),
            'messageContainsHtml' => $this->messageContainsHtml(),
        ];
        if ($this->field) {
            $r['field'] = $this->field;
        }

        return $r;
    }
1185196
public function toJson() {
		$array = array("types"=>array());
		foreach ($this->types as $type) {
			$array["types"][] = $type->toJson();
		}
		if ($this->warningMessage) {
			$array["warning"] = $this->warningMessage;
		}
		return $array;
	}
1260050
public function jsonSerialize()
    {
        // @codeCoverageIgnoreStart
        if ( ! $this->originalFilename()) {
            return [];
        }
        // @codeCoverageIgnoreEnd

        $data = [];

        foreach ($this->variants(true) as $variant) {
            $data[ $variant ] = [
                'path' => $this->variantPath($variant),
                'url'  => $this->url($variant)
            ];
        }

        return $data;
    }