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

Breadcrumb

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

function ObjectIterator::buildDataFromObject

Parameters

object $object:

Return value

array

1 call to ObjectIterator::buildDataFromObject()
ObjectIterator::initialize in vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php
Initializer

File

vendor/justinrainbow/json-schema/src/JsonSchema/Iterator/ObjectIterator.php, line 113

Class

ObjectIterator
@package JsonSchema\Iterator

Namespace

JsonSchema\Iterator

Code

private function buildDataFromObject($object) {
    $result = array();
    $stack = new \SplStack();
    $stack->push($object);
    while (!$stack->isEmpty()) {
        $current = $stack->pop();
        if (is_object($current)) {
            array_push($result, $current);
        }
        foreach ($this->getDataFromItem($current) as $propertyName => $propertyValue) {
            if (is_object($propertyValue) || is_array($propertyValue)) {
                $stack->push($propertyValue);
            }
        }
    }
    return $result;
}

API Navigation

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