diff options
author | Thomas Lange <code@nerdmind.de> | 2021-08-10 20:04:34 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-08-10 20:14:36 +0200 |
commit | 1b1c6f510673ec39c581a3370427adc369aaca6d (patch) | |
tree | 3eb450a7a2b92c1e01ab7583273c24dbc5ab66b8 /core | |
parent | 7c86a4ec9f44579947589828081b78fe5bf437c8 (diff) | |
download | blog-1b1c6f510673ec39c581a3370427adc369aaca6d.tar.gz blog-1b1c6f510673ec39c581a3370427adc369aaca6d.tar.xz blog-1b1c6f510673ec39c581a3370427adc369aaca6d.zip |
Exclude "_modified" property from "getAll" method
The "getAll" method of the Entity class should return an array with real
attributes of the Entity object but not internally used properties.
Diffstat (limited to 'core')
-rw-r--r-- | core/namespace/ORM/Entity.php | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/namespace/ORM/Entity.php b/core/namespace/ORM/Entity.php index 592aeb5..61b9371 100644 --- a/core/namespace/ORM/Entity.php +++ b/core/namespace/ORM/Entity.php @@ -39,6 +39,7 @@ abstract class Entity implements EntityInterface { #=============================================================================== public function getAll(array $exclude = []): array { $attributes = get_object_vars($this); + $exclude = array_merge($exclude, ['_modified']); return array_filter($attributes, function($attribute) use($exclude) { return !in_array($attribute, $exclude); |