| @@ -377,6 +377,21 @@ paths: | |||||
| style: form | style: form | ||||
| explode: false | explode: false | ||||
| allowReserved: false | allowReserved: false | ||||
| - | |||||
| name: 'order[partnerProduct.product.name]' | |||||
| in: query | |||||
| description: '' | |||||
| required: false | |||||
| deprecated: false | |||||
| allowEmptyValue: true | |||||
| schema: | |||||
| type: string | |||||
| enum: | |||||
| - asc | |||||
| - desc | |||||
| style: form | |||||
| explode: false | |||||
| allowReserved: false | |||||
| deprecated: false | deprecated: false | ||||
| post: | post: | ||||
| operationId: api_contact_partner_products_post | operationId: api_contact_partner_products_post | ||||
| @@ -1823,6 +1838,21 @@ paths: | |||||
| style: form | style: form | ||||
| explode: true | explode: true | ||||
| allowReserved: false | allowReserved: false | ||||
| - | |||||
| name: 'order[product.name]' | |||||
| in: query | |||||
| description: '' | |||||
| required: false | |||||
| deprecated: false | |||||
| allowEmptyValue: true | |||||
| schema: | |||||
| type: string | |||||
| enum: | |||||
| - asc | |||||
| - desc | |||||
| style: form | |||||
| explode: false | |||||
| allowReserved: false | |||||
| - | - | ||||
| name: excludeContactId | name: excludeContactId | ||||
| in: query | in: query | ||||
| @@ -7,6 +7,7 @@ | |||||
| namespace App\ApiResource; | namespace App\ApiResource; | ||||
| use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; | |||||
| use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | ||||
| use ApiPlatform\Doctrine\Orm\State\Options; | use ApiPlatform\Doctrine\Orm\State\Options; | ||||
| use ApiPlatform\Metadata\ApiFilter; | use ApiPlatform\Metadata\ApiFilter; | ||||
| @@ -48,6 +49,7 @@ use Symfony\Component\Validator\Constraints\NotBlank; | |||||
| 'contact' => 'exact', | 'contact' => 'exact', | ||||
| 'partnerProduct.product.name' => 'ipartial', | 'partnerProduct.product.name' => 'ipartial', | ||||
| ])] | ])] | ||||
| #[ApiFilter(OrderFilter::class, properties: ['partnerProduct.product.name'], arguments: ['orderParameterName' => 'order'])] | |||||
| class ContactPartnerProductApi | class ContactPartnerProductApi | ||||
| { | { | ||||
| #[ApiProperty(readable: false, writable: false, identifier: true)] | #[ApiProperty(readable: false, writable: false, identifier: true)] | ||||
| @@ -7,6 +7,7 @@ | |||||
| namespace App\ApiResource; | namespace App\ApiResource; | ||||
| use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; | |||||
| use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; | ||||
| use ApiPlatform\Doctrine\Orm\State\Options; | use ApiPlatform\Doctrine\Orm\State\Options; | ||||
| use ApiPlatform\Metadata\ApiFilter; | use ApiPlatform\Metadata\ApiFilter; | ||||
| @@ -52,6 +53,7 @@ use Symfony\Component\Validator\Constraints\NotBlank; | |||||
| 'product.name' => 'ipartial', | 'product.name' => 'ipartial', | ||||
| 'partner.type' => 'exact' | 'partner.type' => 'exact' | ||||
| ])] | ])] | ||||
| #[ApiFilter(OrderFilter::class, properties: ['product.name'], arguments: ['orderParameterName' => 'order'])] | |||||
| #[ApiFilter(PartnerProductUnassignedFilter::class)] | #[ApiFilter(PartnerProductUnassignedFilter::class)] | ||||
| class PartnerProductApi | class PartnerProductApi | ||||
| { | { | ||||
| @@ -45,7 +45,10 @@ use Symfony\Component\Validator\Constraints\NotBlank; | |||||
| processor: EntityClassDtoStateProcessor::class, | processor: EntityClassDtoStateProcessor::class, | ||||
| stateOptions: new Options(entityClass: UserProduct::class), | stateOptions: new Options(entityClass: UserProduct::class), | ||||
| )] | )] | ||||
| #[ApiFilter(SearchFilter::class, properties: ['user' => 'exact', 'product' => 'exact'])] | |||||
| #[ApiFilter(SearchFilter::class, properties: [ | |||||
| 'user' => 'exact', | |||||
| 'product' => 'exact' | |||||
| ])] | |||||
| #[ApiFilter(OrderFilter::class, properties: ['product.name'], arguments: ['orderParameterName' => 'order'])] | #[ApiFilter(OrderFilter::class, properties: ['product.name'], arguments: ['orderParameterName' => 'order'])] | ||||
| class UserProductApi implements OwnerInterface | class UserProductApi implements OwnerInterface | ||||
| { | { | ||||
| @@ -46,6 +46,7 @@ class DocumentEntityToApiMapper implements MapperInterface | |||||
| $dto->name = $entity->getName(); | $dto->name = $entity->getName(); | ||||
| $dto->description = $entity->getDescription(); | $dto->description = $entity->getDescription(); | ||||
| $dto->partnerIri = null; | |||||
| if ($entity->getPartner()) { | if ($entity->getPartner()) { | ||||
| $dto->partnerIri = $dto->partner = $this->microMapper->map($entity->getPartner(), PartnerApi::class, [ | $dto->partnerIri = $dto->partner = $this->microMapper->map($entity->getPartner(), PartnerApi::class, [ | ||||
| MicroMapperInterface::MAX_DEPTH => 1, | MicroMapperInterface::MAX_DEPTH => 1, | ||||