Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Duplicated Value Object Entity Ids
<?php
namespace MyDuplicatedProject\Order;
final class ProductId
{
private $uuid;
public function __construct(UUIDInterface $uuid) {
$this->uuid = $uuid;
}
public function sameAs(ProductId $productId): bool {
return $this->uuid->toString() == $productId->uuid->toString();
}
}
<?php
namespace MyDuplicatedProject\Catalog\Product;
final class ProductId
{
private $uuid;
public function __construct(UUIDInterface $uuid) {
$this->uuid = $uuid;
}
public function toString(): string {
return $this->uuid->toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.