JSON Serialise Method

Called by json_* methods so we can control what items are returned.
@return mixed
337449
public function jsonSerialize(){
		$arrData = array();

		foreach($this as $strKey => $objValue){
			if($this->options($strKey)->json){
				$mixValue = $objValue->jsonSerialize();
				$mixJSON = json_encode($mixValue);
				if((!is_null($mixValue) && $mixJSON!='[]') || $this->options($strKey)->jsonnull){
					$arrData[$strKey] = $mixValue;
				}
			}
		}
		return $arrData;
	}
1083692
public function jsonSerialize()
    {
        $result = array();
        foreach (get_class_methods($this) as $method) {
            if (strncmp('get', $method, 3) === 0) {
                if ($method === 'getUnknownProperties') {
                    continue;
                }
                if ($method === 'getIterator') {
                    continue;
                }
                $property = strtolower(preg_replace('/[A-Z]/', '_\0', lcfirst(substr($method, 3))));
                $value = $this->serializeValueToJson($this->{$method} ());
                if ($value !== null) {
                    $result[$property] = $value;
                }
            }
        }
        if (!empty($this->unknownProperties)) {
            foreach ($this->unknownProperties as $property => $value) {
                if (!array_key_exists($property, $result)) {
                    $result[$property] = $this->serializeValueToJson($value);
                }
            }
        }
        return $result;
    }
149002
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'email' => $this->getEmail()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
181415
public function jsonSerialize()
    {
        $a[Helper::JSON_OBJECT_TYPE] = 'qFunc';
        $a['func'] = $this->strFunctionName;
        if ($this->strContext) {
            $a['context'] = $this->strContext;
        }
        if ($this->params) {
            $a['params'] = $this->params;
        }

        return Helper::makeJsonEncodable($a);
    }
1250918
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();
        $json['width'] = $this->getWidth();
        $json['height'] = $this->getHeight();

        return $json;
    }
616971
public function jsonSerialize() { // @codingStandardsIgnoreLine (CONTRIB-6469).
        $data = [
            'label' => $this->label,
            'labels' => $this->labels,
            'type' => $this->type,
            'values' => $this->values,
            'colors' => $this->colors,
            'axes' => [
                'x' => $this->xaxis,
                'y' => $this->yaxis,
            ],
            'smooth' => $this->smooth
        ];
        return $data;
    }
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;
    }
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;
    }
121801
public function jsonSerialize()
    {
        $json = parent::jsonSerialize();
        $json['fileSize'] = $this->getFileSize();
        $json['mimeType'] = $this->getMimeType();
        $json['fileModifiedAt'] = $this->getFileModifiedAt();
        $json['type'] = static::getType();

        return $json;
    }
757244
public function jsonSerialize()
    {
        $copy = [];
        foreach ((array)$this as $key => $value) {
            if (!is_string($value)) {
                $element = $value->getElement();
                if (is_object($element)
                    and method_exists($element, 'name')
                    and $name = $element->name()
                ) {
                    $copy[$name] = $value instanceof JsonSerializable ? $value->jsonSerialize() : $value;
                }
                $copy[$key] = $value instanceof JsonSerializable ? $value->jsonSerialize() : $value;
            } else {
                $copy[$key] = $value;
            }
        }
        return $copy;
    }
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;
		}
1302246
public function jsonSerialize()
    {
        $r = [
            'message' => $this->getMessage(),
            'messageContainsHtml' => $this->messageContainsHtml(),
        ];
        if ($this->field) {
            $r['field'] = $this->field;
        }

        return $r;
    }
173538
public function jsonSerialize()
    {
        return array_merge($this->toJsonSerialize(), [
            'inheritance' => $this->inheritance,
            'abstract' => $this->isAbstract,
            'meta' => $this->meta,
            'name' => $this->name,
            '__CLASS__' => get_called_class(),
        ]);
    }
339047
public function jsonSerialize()
    {
        return array_filter(
            [
                'bcc' => $this->getBccSettings(),
                'bypass_list_management' => $this->getBypassListManagement(),
                'footer' => $this->getFooter(),
                'sandbox_mode' => $this->getSandboxMode(),
                'spam_check' => $this->getSpamCheck()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
466821
public function jsonSerialize()
    {
        return array_filter(
            [
                'key' => $this->getKey(),
                'value' => $this->getValue()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
237775
public function jsonSerialize()
    {
        $properties = [
            '_templatePath', '_template', '_plugin', '_theme', '_layout', '_autoLayout',
            '_layoutPath', '_name', '_className', '_options', '_helpers'
        ];

        $array = [];

        foreach ($properties as $property) {
            $array[$property] = $this->{$property};
        }

        return array_filter($array, function ($i) {
            return !is_array($i) && strlen($i) || !empty($i);
        });
    }
781817
public function jsonSerialize(): array
    {
        $outObj        = array();
        $outObj['url'] = $this->url;
        if ($this->anchor !== null) {
            $outObj['anchor'] = $this->anchor;
        }
        return $outObj;
    }