Skip to content

Instantly share code, notes, and snippets.

@thunderer
Created August 27, 2019 23:23
Show Gist options
  • Save thunderer/a8805b0cade36a45490b855997cfac6e to your computer and use it in GitHub Desktop.
Save thunderer/a8805b0cade36a45490b855997cfac6e to your computer and use it in GitHub Desktop.
Doctrine + SQLite + UUID = ?
<?php
declare(strict_types=1);
namespace Thunder\Entity;
/* final */ class Account
{
/** @var resource */
private $id;
public function __construct(AccountId $id)
{
$this->id = (string) $id; // === Uuid::getBytes()
}
public function getId(): AccountId
{
return AccountId::fromBytes($this->id);
}
}
<entity name="Thunder\Entity\Account" table="account">
<id name="id" type="binary" length="16" column="id" />
</entity>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment