Files
crowd-fund-api/src/Filter/ResourceVersionResourceIdFilter.php
T
2024-09-25 14:47:53 +02:00

43 lines
1.2 KiB
PHP

<?php
namespace App\Filter;
use ApiPlatform\Doctrine\Orm\Filter\AbstractFilter;
use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
use ApiPlatform\Metadata\Operation;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\PropertyInfo\Type;
final class ResourceVersionResourceIdFilter extends AbstractFilter
{
protected function filterProperty(
string $property,
$value,
QueryBuilder $queryBuilder,
QueryNameGeneratorInterface $queryNameGenerator,
string $resourceClass,
?Operation $operation = null,
array $context = [],
): void {
return;
}
public function getDescription(string $resourceClass): array
{
$description = [];
foreach ($this->properties as $property => $strategy) {
$description["$property"] = [
'property' => $property,
'type' => Type::BUILTIN_TYPE_INT,
'required' => true,
'description' => 'The ID of the named resource.',
'openapi' => [
'allowEmptyValue' => false,
],
];
}
return $description;
}
}