[frontend] restructure components
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Doctrine\Type;
|
||||
|
||||
use App\Entity\Identifier\SignalId;
|
||||
use Symfony\Bridge\Doctrine\Types\AbstractUidType;
|
||||
|
||||
final class SignalIdType extends AbstractUidType
|
||||
{
|
||||
public function getName(): string
|
||||
{
|
||||
return self::class;
|
||||
}
|
||||
|
||||
protected function getUidClass(): string
|
||||
{
|
||||
return SignalId::class;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Doctrine\Type\SignalIdType;
|
||||
use App\Entity\Identifier\SignalId;
|
||||
use App\Repository\SignalRepository;
|
||||
use App\ValueObject\Point;
|
||||
@@ -20,7 +21,7 @@ readonly class Signal
|
||||
#[ORM\Column(type: Types::STRING, length: 64)] public string $userKey,
|
||||
#[ORM\Embedded(class: Point::class, columnPrefix: 'user_')] public Point $userLocation,
|
||||
#[ORM\Embedded(class: Point::class, columnPrefix: 'signal_')] public Point $signalLocation,
|
||||
#[ORM\Id] #[ORM\GeneratedValue(strategy: 'NONE')] #[ORM\Column(type: 'uuid')] public SignalId $id = new SignalId(),
|
||||
#[ORM\Id] #[ORM\GeneratedValue(strategy: 'NONE')] #[ORM\Column(type: SignalIdType::class)] public SignalId $id = new SignalId(),
|
||||
#[ORM\Column(name: 'created_at', type: Types::DATETIME_IMMUTABLE)] public \DateTimeImmutable $createdAt = new \DateTimeImmutable()
|
||||
) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user