protected static function CacheableNormalization::hasNoNestedInstances in JSON:API 8.2
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.
1 call to CacheableNormalization::hasNoNestedInstances()
- CacheableNormalization::__construct in src/
Normalizer/ Value/ CacheableNormalization.php - CacheableNormalization constructor.
File
- 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;
}