Reference
C
Class

ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaLengthRestriction

Class PropertySchemaLengthRestrictions.

class ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaLengthRestriction implements `<a href="/docs/reference/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaRestrictionMetadataInterface">ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface</a>`
{
    public create(Symfony\Component\Validator\Constraints\Length $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
    public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
}
class ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaLengthRestriction implements `<a href="/docs/reference/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaRestrictionMetadataInterface">ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface</a>`
{
    public create(Symfony\Component\Validator\Constraints\Length $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
    public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
}

Methods

create

Creates json schema restrictions based on the validation constraints.

public create(Symfony\Component\Validator\Constraints\Length $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
public create(Symfony\Component\Validator\Constraints\Length $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array

Parameters

constraintSymfony\Component\Validator\Constraints\Length
propertyMetadataApiPlatform\Metadata\ApiProperty

Returns

array

supports

Is the constraint supported by the schema restriction?

public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool

Parameters

constraintSymfony\Component\Validator\Constraint
propertyMetadataApiPlatform\Metadata\ApiProperty

Returns

bool

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop