Specify data which should be serialized to JSON.

@return array
@link   http://php.net/manual/en/jsonserializable.jsonserialize.php
17209
public function jsonSerialize()
    {
        $payload = self::getDefaultPayloadStructure();

        if ($this->alert instanceof Alert || is_string($this->alert)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_ALERT_KEY] = $this->alert;
        }

        if (is_int($this->badge)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_BADGE_KEY] = $this->badge;
        }

        if (is_string($this->sound)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_SOUND_KEY] = $this->sound;
        }

        if (is_bool($this->contentAvailable)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_CONTENT_AVAILABLE_KEY] = (int)$this->contentAvailable;
        }

        if (is_bool($this->mutableContent)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_MUTABLE_CONTENT_KEY] = (int)$this->mutableContent;
        }

        if (is_string($this->category)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_CATEGORY_KEY] = $this->category;
        }

        if (is_string($this->threadId)) {
            $payload[self::PAYLOAD_ROOT_KEY][self::PAYLOAD_THREAD_ID_KEY] = $this->threadId;
        }

        if (is_countable($this->customValues) && count($this->customValues)) {
            $payload = array_merge($payload, $this->customValues);
        }

        return $payload;
    }
850692
public function jsonSerialize(): array
    {
        $data = ['required' => $this->requiresAuth()];
        if ($this->requiresAuth()) {
            $data['requiresLogin'] = $this->requiresLogin();
        }

        if ($this->requiresRoles()) {
            $data['requiresRoles'] = true;
            $data['requiredRole']  = $this->requiredRole();
        }

        return $data;
    }
1252108
public function jsonSerialize()
    {
        $out = [];
        foreach ($this as $model) {
            if (!is_object($model)) {
                continue;
            }
            if ($model instanceof JsonSerializable) {
                $out[] = $model->jsonSerialize();
            } else {
                $out[] = (object)(array)$model;
            }
        }
        return $out;
    }
503683
public function jsonSerialize() {
        return array('count' => $this->totalAmount, 
            'countOfPages' => $this->numberOfPages(), 
            'limit' => $this->amountPerPage,
            'page' => $this->currentPage, 
            'previousPage' => $this->previousPage(), 
            'nextPage' => $this->nextPage());
    }
687315
public function jsonSerialize(): array
	{
		if($this->pagination === null)
		{
			return $this->toArray();
		}

		return ['data' => $this->toArray(), 'pagination' => $this->pagination->toArray()];
	}
165052
public function jsonSerialize()
    {
        return [
            'agent' => $this->agent,
            'approved' => $this->approved,
            'author' => $this->author,
            'author_email' => $this->author_email,
            'author_ip' => $this->author_ip,
            'author_url' => $this->author_url,
            'content' => $this->content,
            'created_at' => $this->created_at,
            'id' => $this->id,
            'karma' => $this->karma,
            'parent_id' => $this->parent_id,
            'post_id' => $this->post_id,
            'replies' => $this->replies,
            'type' => $this->type,
            'user_id' => $this->user_id,
        ];
    }
602510
public function jsonSerialize()
    {
        return Collection::make([
            'url' => $this->url,
            'callback_data' => $this->callbackData,
            'request_contact' => $this->requestContact,
            'request_location' => $this->requestLocation,
            'text' => $this->text,
        ])->filter()->toArray();
    }
1065395
public function jsonSerialize()
    {
        return [
            'host' => $this->host,
            'uri' => $this->uri,
            'method' => $this->method,
            'headers' => $this->headers,
            'body' => $this->body
        ];
    }
1017672
public function serialize()
    {
        $result = [
            'code' => $this->getCode(),
            'message' => $this->getMessage(),
            'errors' => $this->getErrors()
        ];

        $result['data'] = $this->getVariables();

        if ($result['data'] instanceof Traversable) {
            $result['data'] = ArrayUtils::iteratorToArray($result['data']);
        }

        if (null !== $this->jsonpCallback) {
            return $this->jsonpCallback . '(' . Json::encode($result) . ');';
        }

        return Json::encode($result);
    }
1143664
public function jsonSerialize()
		{
			// base values
			$values = (object)
			[
				'name'      => $this->name,
				'type'      => $this->type,
				'value'     => $this->value,
				'text'      => $this->text,
				'field'     => null,
				'attrs'     => (object) [],
			];

			// override if field set
			if (isset($this->field))
			{
				$values->field = $this->field->type;
				$values->attrs = (object) $this->field->attrs;

			}
			return $values;
		}
233430
function jsonSerialize()
    {
        $result = [
            'title'        => $this->getTitle(),
            'link'         => $this->getLink(),
            'publicId'     => $this->getPublicId(),
            'description'  => $this->getDescription(),
            'lastModified' => $this->getLastModified()->format(\DateTime::ATOM),
            'url'          => $this->getUrl(),
            'items'        => $this->getItems(),
            'relations'    => $this->getRelations(),
        ];
        return $result;
    }
541480
public function serialize()
    {
        $output = array();
        foreach( $this->data as $key => $value ) {
            if( !array_key_exists( $key, static::$defaults ) or static::$defaults[$key] !== $value ) {
                $output[$key] = $value;
            }
        }
        return json_encode(
            array(
                $this->name,
                $this->entity,
                $this->fullyQualifiedName,
                $output
            )
        );
    }
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;
    }
1023468
public function jsonSerialize()
    {
        return array_map(function ($value) {
            if ($value instanceof JsonSerializable) {
                return $value->jsonSerialize();
            } else {
                return $value;
            }
        }, $this->items);
    }
1302246
public function jsonSerialize()
    {
        $r = [
            'message' => $this->getMessage(),
            'messageContainsHtml' => $this->messageContainsHtml(),
        ];
        if ($this->field) {
            $r['field'] = $this->field;
        }

        return $r;
    }
1016152
public function jsonSerialize()
    {
        $jsonData = [
            'identity'   => $this->identity,
            'public_key' => $this->publicKey,
            'version'    => $this->version,
            'created_at' => $this->createdAt,
        ];

        if ($this->previousCardId != null) {
            $jsonData['previous_card_id'] = $this->previousCardId;
        }

        return $jsonData;
    }
988571
public function serialize()
    {
        return json_encode(
            array(
                self::KEY_STATE => $this->jsonableStates,
                self::KEY_TRANSITION => $this->jsonableTransitions
            )
        );
    }