Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Node.php

function Node::jsonSerialize

Returns a serializable version of the node

Return value

array

4 calls to Node::jsonSerialize()
Comment::jsonSerialize in vendor/mck89/peast/lib/Peast/Syntax/Node/Comment.php
Returns a serializable version of the node
Comment::jsonSerialize in vendor/mck89/peast/lib/Peast/Syntax/Node/Comment.php
Returns a serializable version of the node
TemplateLiteral::jsonSerialize in vendor/mck89/peast/lib/Peast/Syntax/Node/TemplateLiteral.php
Returns a serializable version of the node
TemplateLiteral::jsonSerialize in vendor/mck89/peast/lib/Peast/Syntax/Node/TemplateLiteral.php
Returns a serializable version of the node
2 methods override Node::jsonSerialize()
Comment::jsonSerialize in vendor/mck89/peast/lib/Peast/Syntax/Node/Comment.php
Returns a serializable version of the node
TemplateLiteral::jsonSerialize in vendor/mck89/peast/lib/Peast/Syntax/Node/TemplateLiteral.php
Returns a serializable version of the node

File

vendor/mck89/peast/lib/Peast/Syntax/Node/Node.php, line 183

Class

Node
Base class for all the nodes generated by Peast.

Namespace

Peast\Syntax\Node

Code

public function jsonSerialize() {
    $ret = array();
    $props = \Peast\Syntax\Utils::getNodeProperties($this);
    foreach ($props as $prop) {
        $ret[$prop["name"]] = $this->{$prop["getter"]}();
    }
    return $ret;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal