From e8d5caefea483d467cde0e88c39d9fcd8645b5a1 Mon Sep 17 00:00:00 2001 From: iglocska Date: Tue, 9 Jun 2020 15:58:49 +0200 Subject: [PATCH] new: [UUID] behaviour added - auto set UUIDs on objects --- app/src/Model/Behavior/UUIDBehavior.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/src/Model/Behavior/UUIDBehavior.php diff --git a/app/src/Model/Behavior/UUIDBehavior.php b/app/src/Model/Behavior/UUIDBehavior.php new file mode 100644 index 0000000..cdb659a --- /dev/null +++ b/app/src/Model/Behavior/UUIDBehavior.php @@ -0,0 +1,18 @@ +isNew() && empty($entity['uuid'])) { + $entity['uuid'] = Text::uuid(); + } + } +}