|
|
|
@@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface; |
|
|
|
#[ApiFilter(ProductUnassignedFilter::class)] |
|
|
|
class ProductUnassignedFilter extends AbstractFilter |
|
|
|
{ |
|
|
|
public const FILTER_NAME = "partnerIdUnassigned"; |
|
|
|
public const FILTER_NAME = "excludePartnerId"; |
|
|
|
|
|
|
|
public function __construct(ManagerRegistry $managerRegistry, ?LoggerInterface $logger = null, ?array $properties = null) |
|
|
|
{ |
|
|
|
@@ -27,7 +27,7 @@ class ProductUnassignedFilter extends AbstractFilter |
|
|
|
|
|
|
|
protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?\ApiPlatform\Metadata\Operation $operation = null, array $context = []): void |
|
|
|
{ |
|
|
|
if ($property !== 'unassignedPartnerId') { |
|
|
|
if ($property !== self::FILTER_NAME) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -51,8 +51,8 @@ class ProductUnassignedFilter extends AbstractFilter |
|
|
|
'required' => false, |
|
|
|
'swagger' => [ |
|
|
|
'description' => 'Filter products that are not assigned to a given partner id', |
|
|
|
'type' => 'integer', // Hier wird der Datentyp auf 'integer' gesetzt |
|
|
|
'format' => 'partner_id', // Optional: Format 'partner_id' angeben, um klarzustellen, dass es sich um eine Partner-ID handelt |
|
|
|
'type' => 'integer', |
|
|
|
'format' => 'partner_id', |
|
|
|
], |
|
|
|
], |
|
|
|
]; |
|
|
|
|