Browse Source

wip search

master
Daniel 1 year ago
parent
commit
560143fedb
5 changed files with 35 additions and 1 deletions
  1. +1
    -1
      export/openapi.json
  2. +24
    -0
      export/openapi.yaml
  3. +1
    -0
      src/ApiResource/PartnerFollowApi.php
  4. +1
    -0
      src/ApiResource/PartnerProductApi.php
  5. +8
    -0
      src/Mapper/PartnerProductEntityToApiMapper.php

+ 1
- 1
export/openapi.json
File diff suppressed because it is too large
View File


+ 24
- 0
export/openapi.yaml View File

@@ -1462,6 +1462,18 @@ paths:
style: form style: form
explode: true explode: true
allowReserved: false allowReserved: false
-
name: partner.name
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
style: form
explode: false
allowReserved: false
- -
name: user name: user
in: query in: query
@@ -1723,6 +1735,18 @@ paths:
style: form style: form
explode: true explode: true
allowReserved: false allowReserved: false
-
name: partner.name
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
style: form
explode: false
allowReserved: false
- -
name: product name: product
in: query in: query


+ 1
- 0
src/ApiResource/PartnerFollowApi.php View File

@@ -46,6 +46,7 @@ use Symfony\Component\Validator\Constraints\NotBlank;
)] )]
#[ApiFilter(SearchFilter::class, properties: [ #[ApiFilter(SearchFilter::class, properties: [
'partner' => 'exact', 'partner' => 'exact',
'partner.name' => 'ipartial',
'user' => 'exact', 'user' => 'exact',
'partner.type' => 'exact' 'partner.type' => 'exact'
])] ])]


+ 1
- 0
src/ApiResource/PartnerProductApi.php View File

@@ -45,6 +45,7 @@ use Symfony\Component\Validator\Constraints\NotBlank;
)] )]
#[ApiFilter(SearchFilter::class, properties: [ #[ApiFilter(SearchFilter::class, properties: [
'partner' => 'exact', 'partner' => 'exact',
'partner.name' => 'ipartial',
'product' => 'exact', 'product' => 'exact',
'product.name' => 'ipartial', 'product.name' => 'ipartial',
'partner.type' => 'exact' 'partner.type' => 'exact'


+ 8
- 0
src/Mapper/PartnerProductEntityToApiMapper.php View File

@@ -41,10 +41,18 @@ class PartnerProductEntityToApiMapper implements MapperInterface
MicroMapperInterface::MAX_DEPTH => 1, MicroMapperInterface::MAX_DEPTH => 1,
]); ]);


$dto->partner = $this->microMapper->map($entity->getPartner(), PartnerApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
]);

$dto->productIri = $dto->product = $this->microMapper->map($entity->getProduct(), ProductApi::class, [ $dto->productIri = $dto->product = $this->microMapper->map($entity->getProduct(), ProductApi::class, [
MicroMapperInterface::MAX_DEPTH => 1, MicroMapperInterface::MAX_DEPTH => 1,
]); ]);


$dto->product = $dto->product = $this->microMapper->map($entity->getProduct(), ProductApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
]);

$dto->createdAt = $entity->getCreatedAt(); $dto->createdAt = $entity->getCreatedAt();


return $dto; return $dto;


Loading…
Cancel
Save