if (!
$allowExtraAttributes) { throw new LogicException(sprintf('A class metadata factory must be provided in the constructor when setting "%s" to false.', self::ALLOW_EXTRA_ATTRIBUTES
));
} return false;
} $groups =
$this->
getGroups($context);
$allowedAttributes =
[];
$ignoreUsed = false;
foreach ($this->classMetadataFactory->
getMetadataFor($classOrObject)->
getAttributesMetadata() as $attributeMetadata) { if ($ignore =
$attributeMetadata->
isIgnored()) { $ignoreUsed = true;
} // If you update this check, update accordingly the one in Symfony\Component\PropertyInfo\Extractor\SerializerExtractor::getProperties()
if ( !
$ignore && ([] ===
$groups ||
array_intersect(array_merge($attributeMetadata->
getGroups(),
['*'
]),
$groups)) &&
$this->
isAllowedAttribute($classOrObject,
$name =
$attributeMetadata->
getName(), null,
$context) ) { $allowedAttributes[] =
$attributesAsString ?
$name :
$attributeMetadata;
}