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\IteratorCode
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;
}