56 lines
1.3 KiB
PHP
56 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Domain\Location\Model\Persisted;
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
#[ORM\Entity]
|
|
#[ORM\Table(name: 'addresses')]
|
|
class PersistedAddress
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column(type: 'integer')]
|
|
public private(set) ?int $id = null {
|
|
get => $this->id;
|
|
set => $this->id = $value;
|
|
}
|
|
|
|
#[ORM\Column(type: 'string', length: 100)]
|
|
public private(set) string $addressLine {
|
|
get => $this->addressLine;
|
|
set => $this->addressLine = $value;
|
|
}
|
|
|
|
#[ORM\Column(type: 'string', length: 100)]
|
|
public private(set) string $city {
|
|
get => $this->city;
|
|
set => $this->city = $value;
|
|
}
|
|
|
|
#[ORM\Column(type: 'string', length: 2)]
|
|
public private(set) string $countryAlpha2 {
|
|
get => $this->countryAlpha2;
|
|
set => $this->countryAlpha2 = $value;
|
|
}
|
|
|
|
#[ORM\Column(type: 'string', length: 10, nullable: true)]
|
|
public private(set) ?string $zipCode = null {
|
|
get => $this->zipCode;
|
|
set => $this->zipCode = $value;
|
|
}
|
|
|
|
public function __construct(
|
|
string $addressLine,
|
|
string $city,
|
|
string $countryAlpha2,
|
|
?string $zipCode = null,
|
|
) {
|
|
$this->addressLine = $addressLine;
|
|
$this->city = $city;
|
|
$this->countryAlpha2 = $countryAlpha2;
|
|
$this->zipCode = $zipCode;
|
|
}
|
|
}
|
|
|