mirror of
https://github.com/openvk/chandler.git
synced 2025-04-01 14:03:59 +03:00
Allow unwrapping database models to raw record data
This commit is contained in:
parent
9606b74aed
commit
064b392671
1 changed files with 5 additions and 0 deletions
|
@ -63,6 +63,11 @@ abstract class DBEntity
|
||||||
return (bool) $this->getRecord()->deleted;
|
return (bool) $this->getRecord()->deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unwrap(): object
|
||||||
|
{
|
||||||
|
return (object) $this->getRecord()->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
function delete(bool $softly = true): void
|
function delete(bool $softly = true): void
|
||||||
{
|
{
|
||||||
if(is_null($this->record))
|
if(is_null($this->record))
|
||||||
|
|
Loading…
Reference in a new issue