protected static function CacheableNormalization::hasNoNestedInstances in Drupal 10
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/Normalizer/Value/CacheableNormalization.php \Drupal\jsonapi\Normalizer\Value\CacheableNormalization::hasNoNestedInstances()
- 9 core/modules/jsonapi/src/Normalizer/Value/CacheableNormalization.php \Drupal\jsonapi\Normalizer\Value\CacheableNormalization::hasNoNestedInstances()
Ensures that no nested values are instances of this class.
Parameters
array|\Traversable $array: The traversable object which may contain instance of this object.
Return value
bool Whether the given object or its children have CacheableNormalizations in them.
File
- core/
modules/ jsonapi/ src/ Normalizer/ Value/ CacheableNormalization.php, line 131
Class
- CacheableNormalization
- Use to store normalized data and its cacheability.
Namespace
Drupal\jsonapi\Normalizer\ValueCode
protected static function hasNoNestedInstances($array) {
foreach ($array as $value) {
if ((is_array($value) || $value instanceof \Traversable) && !static::hasNoNestedInstances($value) || $value instanceof static) {
return FALSE;
}
}
return TRUE;
}