From 064b39267157c8da3d105b1168b58db093f097ad Mon Sep 17 00:00:00 2001 From: Jill Stingray Date: Sat, 1 Aug 2020 14:10:44 +0000 Subject: [PATCH] Allow unwrapping database models to raw record data --- chandler/Database/DBEntity.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chandler/Database/DBEntity.php b/chandler/Database/DBEntity.php index 321710d..b32420a 100644 --- a/chandler/Database/DBEntity.php +++ b/chandler/Database/DBEntity.php @@ -63,6 +63,11 @@ abstract class DBEntity return (bool) $this->getRecord()->deleted; } + function unwrap(): object + { + return (object) $this->getRecord()->toArray(); + } + function delete(bool $softly = true): void { if(is_null($this->record))