From 94a3dd52da3ae180af37c6fd0e8c24b3562da388 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 4 Oct 2023 11:32:04 +0200 Subject: initial commit 2 --- src/Model/Event/SendUnits.php | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/Model/Event/SendUnits.php (limited to 'src/Model/Event/SendUnits.php') diff --git a/src/Model/Event/SendUnits.php b/src/Model/Event/SendUnits.php new file mode 100644 index 0000000..f104a08 --- /dev/null +++ b/src/Model/Event/SendUnits.php @@ -0,0 +1,41 @@ +payload, true); + + if ($payload['type'] === 'Recall' || $payload['type'] === 'SendBack') { + DB::query( + << $payload['amount'], 'type' => $payload['unit'], 'id' => $payload['destination']] + ); + } + + else if ($payload['type'] === 'Borrow') { + DB::query( + << $payload['amount'], 'type' => $payload['unit'], 'home' => $this->villageId, 'residence' => $payload['destination']] + ); + } + } +} -- cgit v1.2.3