Skip to content

Commit 8752bf5

Browse files
Fix
1 parent f281864 commit 8752bf5

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

src/Doctrine/Odm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
"require": {
2727
"php": ">=8.2",
28-
"api-platform/doctrine-common": "^4.2.9",
28+
"api-platform/doctrine-common": "^4.2.13",
2929
"api-platform/metadata": "^4.2",
3030
"api-platform/state": "^4.2.4",
3131
"doctrine/mongodb-odm": "^2.10",

src/Doctrine/Orm/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
],
2525
"require": {
2626
"php": ">=8.2",
27-
"api-platform/doctrine-common": "^4.2.9",
27+
"api-platform/doctrine-common": "^4.2.13",
2828
"api-platform/metadata": "^4.2",
2929
"api-platform/state": "^4.2.4",
3030
"doctrine/orm": "^2.17 || ^3.0"

tests/Fixtures/TestBundle/Document/Chicken.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ class Chicken
4949
#[ODM\Field(type: 'string')]
5050
private string $name;
5151

52+
#[ODM\Field(type: 'string')]
53+
private string $nameConverted;
54+
55+
#[ODM\Field(type: 'string')]
56+
private string $nameNotConverted;
57+
5258
#[ODM\Field(type: 'string', nullable: true)]
5359
private ?string $ean;
5460

@@ -68,10 +74,22 @@ public function getName(): ?string
6874
public function setName(string $name): self
6975
{
7076
$this->name = $name;
77+
$this->nameConverted = $name;
78+
$this->nameNotConverted = $name;
7179

7280
return $this;
7381
}
7482

83+
public function getNameConverted(): ?string
84+
{
85+
return $this->nameConverted;
86+
}
87+
88+
public function getNameNotConverted(): ?string
89+
{
90+
return $this->nameNotConverted;
91+
}
92+
7593
public function getEan(): ?string
7694
{
7795
return $this->ean;

tests/Fixtures/TestBundle/Document/FilteredBooleanParameter.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,44 @@
3333
property: 'active',
3434
nativeType: new BuiltinType(TypeIdentifier::BOOL),
3535
),
36+
'nameConverted' => new QueryParameter(
37+
filter: new BooleanFilter(),
38+
nativeType: new BuiltinType(TypeIdentifier::BOOL),
39+
),
40+
'nameNotConverted' => new QueryParameter(
41+
filter: new BooleanFilter(),
42+
nativeType: new BuiltinType(TypeIdentifier::BOOL),
43+
),
44+
'aliasWithNameConverter' => new QueryParameter(
45+
filter: new BooleanFilter(),
46+
property: 'nameConverted',
47+
nativeType: new BuiltinType(TypeIdentifier::BOOL),
48+
),
49+
'aliasWithoutNameConverter' => new QueryParameter(
50+
filter: new BooleanFilter(),
51+
property: 'nameNotConverted',
52+
nativeType: new BuiltinType(TypeIdentifier::BOOL),
53+
),
3654
],
3755
)]
3856
#[ODM\Document]
3957
class FilteredBooleanParameter
4058
{
59+
#[ODM\Field(type: 'bool', nullable: true)]
60+
private ?bool $nameConverted;
61+
62+
#[ODM\Field(type: 'bool', nullable: true)]
63+
private ?bool $nameNotConverted;
64+
4165
public function __construct(
4266
#[ODM\Id(type: 'int', strategy: 'INCREMENT')]
4367
public ?int $id = null,
4468

4569
#[ODM\Field(type: 'bool', nullable: true)]
4670
public ?bool $active = null,
4771
) {
72+
$this->nameConverted = $this->active;
73+
$this->nameNotConverted = $this->active;
4874
}
4975

5076
public function getId(): ?int
@@ -60,5 +86,7 @@ public function isActive(): bool
6086
public function setActive(?bool $active): void
6187
{
6288
$this->active = $active;
89+
$this->nameConverted = $active;
90+
$this->nameNotConverted = $active;
6391
}
6492
}

0 commit comments

Comments
 (0)