Specify data which should be serialized to JSON
@link http://php.net/manual/en/jsonserializable.jsonserialize.php
@return mixed data which can be serialized by <b>json_encode</b>,
which is a value of any type other than a resource.
@since 5.4.0
497780
public function jsonSerialize()
    {
        $arr = parent::jsonSerialize();
        $vars = get_object_vars($this);
        return array_merge($vars, $arr);
    }
758616
public function jsonSerialize()
    {
        $serializer = $this->localSerializer ?? static::$serializer;
        if ($serializer) {
            return is_string($serializer)
                ? $this->rawFormat($serializer)
                : call_user_func($serializer, $this);
        }

        return $this->toJSON();
    }
1066950
public function serialize()
    {
        $data = array();

        $skip = array(
            'connection',
            'platform',
            'driver'
        );

        foreach ($this as $key => $value) {
            if (in_array($key, $skip)) {
                continue;
            }
            $data[$key] = $value;
        }

        return serialize($data);
    }
28449
public function jsonSerialize(){
		if(is_object($this->mixValue)){
			$mixJSON = json_encode($this->mixValue);
			if((!is_null($this->mixValue) && $mixJSON!='[]') || ($this->hasOption('jsonnull') && $this->options()->jsonnull)){
				return $this->mixValue;
			}
		}

		return null;
	}
344137
public function jsonSerialize()
    {
        $jsonArray = $this->getArrayCopy();
        unset($jsonArray['inputFilter']);
        unset($jsonArray['__initializer__']);
        unset($jsonArray['__cloner__']);
        unset($jsonArray['__isInitialized__']);
        unset($jsonArray['game']);
        unset($jsonArray['cards']);
        unset($jsonArray['distribution']);
        unset($jsonArray['createdAt']);
        unset($jsonArray['updatedAt']);

        return $jsonArray;
    }
470158
public function toArrayAll()
    {
        $data = $this->toArray();

        foreach(self::$jsonable as $key){

            if(isset($data[$key]) && Utils::isJson($data[$key])){
                $data[$key] = json_decode($this->{$key});
            }
        }

        return $data;
    }
473309
public function jsonSerialize()
    {
        $reflObject = new ReflectionObject($this);
        $properties = $reflObject->getProperties(ReflectionProperty::IS_PROTECTED);

        $data = [];
        foreach ($properties as $property) {
            $propertyName = $property->getName();

            $data[$propertyName] = $this->{$propertyName};
        }

        return $data;
    }
1349255
public function jsonSerialize()
    {
        $coded = array(
            'type' => $this->getType(),
            'title' => $this->getTitle(),
            'description' => $this->getDescription(),
            'symbol' => $this->getSymbol(),
            'currency' => $this->getCurrency()
        );
        return $coded;
    }
822466
public function jsonSerialize()
    {
        // if formatting is requested, well then format baby!
        $config = $this->di->get('config');
        if ($config['application']['propertyFormatTo'] == 'none') {
            $attributes = $this->attributes;
        } else {
            $inflector = $this->di->get('inflector');
            $attributes = [];
            foreach ($this->attributes as $key => $value) {
                $attributes[$inflector->normalize($key,
                    $config['application']['propertyFormatTo'])] = $value;
            }
        }

        $result = [
            'id' => $this->id,
            'type' => $this->type,
            'attributes' => $attributes
        ];

        if ($this->relationships) {
            $result['relationships'] = $this->relationships;
        }

        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;
    }
1324639
public function jsonSerialize() {
    // Define empty attribute values.
    // @see http://php.net/manual/en/language.types.boolean.php#language.types.boolean.casting
    $present = function($value) {
      if ($value === NULL) {
        return FALSE;
      }
      if (is_string($value)) {
        return $value !== '';
      }
      if (is_array($value)) {
        return (bool) $value;
      }
      return TRUE;
    };

    // Protected attributes are not outputted via parent::__toString().
    $out = get_object_vars($this);

    // Required attributes.
    $names = array_diff(array_keys($out), $this->optional());
    foreach ($names as $name) {
      if (!isset($out[$name]) || !$present($out[$name])) {
        $this->triggerError("Missing required attribute ${name}.");
        return NULL;
      }
    }

    // Unset optional attributes.
    $names = array_intersect($this->optional(), array_keys($out));
    foreach ($names as $name) {
      if (!$present($out[$name])) {
        unset($out[$name]);
      }
    }

    // Return empty object, not array.
    if (empty($out)) {
      return new \stdClass();
    }

    return $out;
  }
334950
public function jsonSerialize()
    {
        $data = [
            '@context' => [],
            '@id' => $this->uri,
        ];
        $types = $this->types;
        if (!empty($types)) {
            $data['@type'] = $this->transfromArray($types);
        }

        if (!$this->triples instanceof \core_kernel_classes_ContainerCollection) {
            return $data;
        }

        $triples = $this->triples->toArray();
        $map = [];
        foreach ($triples as $key => $triple) {
            if (in_array($triple->predicate, $this->blackList)) {
                continue;
            }

            if (!isset($map[$triple->predicate])) {
                $id = $this->generateId($triple->predicate);
                if (in_array($id, $map)) {
                    $nr = 0;
                    while (in_array($id . '_' . $nr, $map)) {
                        $nr++;
                    }
                    $id = $id . '_' . $nr;
                }
                $map[$triple->predicate] = $id;
                $data['@context'][$id] = $triple->predicate;
            }

            $key = $map[$triple->predicate];
            if (isset($data[$key])) {
                if (!is_array($data[$key])) {
                    $data[$key] = array($data[$key]);
                }
                $data[$key][] = $this->encodeValue($triple->object, $triple->predicate);
            } else {
                $data[$key] = $this->encodeValue($triple->object, $triple->predicate);
            }
        }

        // Enforce serialization to object if context is empty
        $data['@context'] = (object) $data['@context'];

        return $data;
    }
453624
public function jsonSerialize()
    {
        $allFields = parent::jsonSerialize();
        $compositeFields = CompositeDTOMapper::compositeFields(get_class($this));
        foreach ($compositeFields as $key) {
            if (isset($this->$key)) {
                $allFields[$key] = $this->resolveSubresource($key, $this->$key, $this->name());
            }
        }
        return $allFields;
    }
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;
    }
413218
public function serialize() {
        $data = array();
        foreach (get_object_vars($this) as $name => $value) {
            if (! $this->filterRequestNames($name)) {
                $data[$name] = $value;
            }
        }
        return serialize($data);
    }
712732
public function jsonSerialize()
    {
        return array_filter(
            [
                'type' => $this->getType(),
                'value' => $this->getValue()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
560268
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'enable_text' => $this->getEnableText()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }