References NumericFilterTrait
Reference
T
Trait

ApiPlatform\Doctrine\Common\Filter\NumericFilterTrait

Trait for filtering the collection by numeric values.

trait ApiPlatform\Doctrine\Common\Filter\NumericFilterTrait
{
    public getDescription(string $resourceClass): array
    protected getType(null|string $doctrineType): string
    protected getProperties(): array
    protected getLogger(): Psr\Log\LoggerInterface
    protected normalizePropertyName(string $property): string
    protected isNumericField(string $property, string $resourceClass): bool
    protected normalizeValues($value, string $property): array
    protected isNumericArray(array $values): bool
    protected getClassMetadata(string $resourceClass): Doctrine\Persistence\Mapping\ClassMetadata
    protected isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation): bool
    protected isPropertyNested(string $property, string $resourceClass): bool
    protected isPropertyEmbedded(string $property, string $resourceClass): bool
    protected splitPropertyParts(string $property, string $resourceClass): array
    protected getDoctrineFieldType(string $property, string $resourceClass): string
    protected getNestedMetadata(string $resourceClass, array<int, string> $associations): Doctrine\Persistence\Mapping\ClassMetadata
}

Methods

getDescription

public getDescription(string $resourceClass): array

Parameters

resourceClassstring

Returns

array

getType

Gets the PHP type corresponding to this Doctrine type.

protected getType(null|string $doctrineType): string

Parameters

doctrineTypestring

Returns

string

getProperties

protected getProperties(): array

Returns

array

getLogger

protected getLogger(): Psr\Log\LoggerInterface

Returns

Psr\Log\LoggerInterface

normalizePropertyName

protected normalizePropertyName(string $property): string

Parameters

propertystring

Returns

string

isNumericField

Determines whether the given property refers to a numeric field.

protected isNumericField(string $property, string $resourceClass): bool

Parameters

propertystring
resourceClassstring

Returns

bool

normalizeValues

protected normalizeValues($value, string $property): array

Parameters

value
propertystring

Returns

array

isNumericArray

protected isNumericArray(array $values): bool

Parameters

valuesarray

Returns

bool

getClassMetadata

Gets class metadata for the given resource.

protected getClassMetadata(string $resourceClass): Doctrine\Persistence\Mapping\ClassMetadata

Parameters

resourceClassstring

Returns

Doctrine\Persistence\Mapping\ClassMetadata

isPropertyMapped

Determines whether the given property is mapped.

protected isPropertyMapped(string $property, string $resourceClass, bool $allowAssociation): bool

Parameters

propertystring
resourceClassstring
allowAssociationbool

Returns

bool

isPropertyNested

Determines whether the given property is nested.

protected isPropertyNested(string $property, string $resourceClass): bool

Parameters

propertystring
resourceClassstring

Returns

bool

isPropertyEmbedded

Determines whether the given property is embedded.

protected isPropertyEmbedded(string $property, string $resourceClass): bool

Parameters

propertystring
resourceClassstring

Returns

bool

splitPropertyParts

Splits the given property into parts.Returns an array with the following keys:

  • associations: array of associations according to nesting order
  • field: string holding the actual field (leaf node)
protected splitPropertyParts(string $property, string $resourceClass): array

Parameters

propertystring
resourceClassstring

Returns

array

getDoctrineFieldType

Gets the Doctrine Type of a given property/resourceClass.

protected getDoctrineFieldType(string $property, string $resourceClass): string

Parameters

propertystring
resourceClassstring

Returns

string

getNestedMetadata

Gets nested class metadata for the given resource.

protected getNestedMetadata(string $resourceClass, array<int, string> $associations): Doctrine\Persistence\Mapping\ClassMetadata

Parameters

resourceClassstring
associationsarray<int, string>

Returns

Doctrine\Persistence\Mapping\ClassMetadata

Made with love by

Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.

Learn more

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop