-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11576 from eltharin/newnestedDto
Re: Re: Add support for using nested DTOs
- Loading branch information
Showing
16 changed files
with
402 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\DDC6573; | ||
|
||
final class DDC6573Currency | ||
{ | ||
public function __construct(private readonly string $code) | ||
{ | ||
} | ||
|
||
public function getCode(): string | ||
{ | ||
return $this->code; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\DDC6573; | ||
|
||
use Doctrine\DBAL\Types\Types; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\GeneratedValue; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\Table; | ||
|
||
#[Entity] | ||
#[Table(name: 'ddc6573_items')] | ||
class DDC6573Item | ||
{ | ||
/** @var int */ | ||
#[Id] | ||
#[Column(type: Types::INTEGER)] | ||
#[GeneratedValue(strategy: 'AUTO')] | ||
public $id; | ||
|
||
#[Column(type: Types::STRING)] | ||
public string $name; | ||
|
||
#[Column(type: Types::INTEGER)] | ||
public int $priceAmount; | ||
|
||
#[Column(type: Types::STRING, length: 3)] | ||
public string $priceCurrency; | ||
|
||
public function __construct(string $name, DDC6573Money $price) | ||
{ | ||
$this->name = $name; | ||
$this->priceAmount = $price->getAmount(); | ||
$this->priceCurrency = $price->getCurrency()->getCode(); | ||
} | ||
|
||
public function getPrice(): DDC6573Money | ||
{ | ||
return new DDC6573Money($this->priceAmount, new DDC6573Currency($this->priceCurrency)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\DDC6573; | ||
|
||
final class DDC6573Money | ||
{ | ||
public function __construct( | ||
private readonly int $amount, | ||
private readonly DDC6573Currency $currency, | ||
) { | ||
} | ||
|
||
public function getAmount(): int | ||
{ | ||
return $this->amount; | ||
} | ||
|
||
public function getCurrency(): DDC6573Currency | ||
{ | ||
return $this->currency; | ||
} | ||
} |
Oops, something went wrong.