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

Breadcrumb

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

function Utils::getPropertiesMap

Returns the properties map for the given node

Parameters

mixed $node Node or class to consider:

Return value

array

1 call to Utils::getPropertiesMap()
Utils::getNodeProperties in vendor/mck89/peast/lib/Peast/Syntax/Utils.php
Returns the properties list for the given node

File

vendor/mck89/peast/lib/Peast/Syntax/Utils.php, line 231

Class

Utils
Utilities class.

Namespace

Peast\Syntax

Code

protected static function getPropertiesMap($node) {
    static $cache = array();
    if ($node instanceof \ReflectionClass) {
        $className = $node->getName();
    }
    else {
        $className = get_class($node);
    }
    if (!isset($cache[$className])) {
        $class = new \ReflectionClass($className);
        $parent = $class->getParentClass();
        $props = $parent ? self::getPropertiesMap($parent) : array();
        $defaults = $class->getDefaultProperties();
        if (isset($defaults["propertiesMap"])) {
            $props = array_merge($props, $defaults["propertiesMap"]);
        }
        $cache[$className] = $props;
    }
    return $cache[$className];
}

API Navigation

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