protected function isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation = false) : bool
{
if ($this->isPropertyNested($property)) {
$propertyParts = $this->splitPropertyParts($property);
$metadata = $this->getNestedMetadata($resourceClass, $propertyParts['associations']);
$property = $propertyParts['field'];
} else {
$metadata = $this->getClassMetadata($resourceClass);
}
return $metadata->hasField($property) || $allowAssociation && $metadata->hasAssociation($property);
}