ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractFilter::isPropertyMapped PHP Method

isPropertyMapped() protected method

Determines whether the given property is mapped.
protected isPropertyMapped ( string $property, string $resourceClass, boolean $allowAssociation = false ) : boolean
$property string
$resourceClass string
$allowAssociation boolean
return boolean
    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);
    }