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

Breadcrumb

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

function XmlFileLoader::parseContext

1 call to XmlFileLoader::parseContext()
XmlFileLoader::loadClassMetadata in vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php

File

vendor/symfony/serializer/Mapping/Loader/XmlFileLoader.php, line 158

Class

XmlFileLoader
Loads XML mapping files.

Namespace

Symfony\Component\Serializer\Mapping\Loader

Code

private function parseContext(\SimpleXMLElement $nodes) : array {
    $context = [];
    foreach ($nodes as $node) {
        if (\count($node) > 0) {
            if (\count($node->entry) > 0) {
                $value = $this->parseContext($node->entry);
            }
            else {
                $value = [];
            }
        }
        else {
            $value = XmlUtils::phpize($node);
        }
        if (isset($node['name'])) {
            $context[(string) $node['name']] = $value;
        }
        else {
            $context[] = $value;
        }
    }
    return $context;
}

API Navigation

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