mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-17 01:57:00 +02:00
Application create is possible via EPP too
This commit is contained in:
parent
f2326a92e0
commit
c5b2783fbf
3 changed files with 629 additions and 343 deletions
|
@ -23,6 +23,9 @@ use Money\Currency;
|
|||
use Money\Converter;
|
||||
use Money\Currencies\ISOCurrencies;
|
||||
use Money\Exchange\FixedExchange;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use Ramsey\Uuid\Guid\Guid;
|
||||
use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
|
||||
|
||||
/**
|
||||
* Sets up and returns a Logger instance.
|
||||
|
@ -859,6 +862,20 @@ function formatMoney(Money $money) {
|
|||
return number_format($money->getAmount() / 100, 2, '.', '');
|
||||
}
|
||||
|
||||
function createUuidFromId($id) {
|
||||
// Define a namespace UUID; this should be a UUID that is unique to your application
|
||||
$namespace = '123e4567-e89b-12d3-a456-426614174000';
|
||||
|
||||
// Generate a UUIDv5 based on the namespace and a name (in this case, the $id)
|
||||
try {
|
||||
$uuid5 = Uuid::uuid5($namespace, (string)$id);
|
||||
return $uuid5->toString();
|
||||
} catch (UnsatisfiedDependencyException $e) {
|
||||
// Handle exception
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch a single value from the database using PDO.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue