class JsonSimpleXMLElementDecorator implements JsonSerializable (View source)

Class JsonSimpleXMLElementDecorator.

Constants

DEF_DEPTH

Properties

protected SimpleXMLElement $subject
protected array $options

Methods

__construct(SimpleXMLElement $element, bool $useAttributes = true, bool $useText = true, int $depth = self::DEF_DEPTH)

Constructor.

void
useAttributes(bool $bool)

Should use attributes.

void
useText(bool $bool)

Should use text.

void
setDepth(int $depth)

Set depth.

mixed
jsonSerialize()

Specify data which should be serialized to JSON.

Details

__construct(SimpleXMLElement $element, bool $useAttributes = true, bool $useText = true, int $depth = self::DEF_DEPTH)

Constructor.

Parameters

SimpleXMLElement $element
bool $useAttributes
bool $useText
int $depth

void useAttributes(bool $bool)

Should use attributes.

Parameters

bool $bool

Return Value

void

void useText(bool $bool)

Should use text.

Parameters

bool $bool

Return Value

void

void setDepth(int $depth)

Set depth.

Parameters

int $depth

Return Value

void

mixed jsonSerialize()

Specify data which should be serialized to JSON.

Return Value

mixed

Data which can be serialized by json_encode