aboutsummaryrefslogtreecommitdiffstats
path: root/core/namespace/ORM
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-08-10 20:04:34 +0200
committerThomas Lange <code@nerdmind.de>2021-08-10 20:14:36 +0200
commit1b1c6f510673ec39c581a3370427adc369aaca6d (patch)
tree3eb450a7a2b92c1e01ab7583273c24dbc5ab66b8 /core/namespace/ORM
parent7c86a4ec9f44579947589828081b78fe5bf437c8 (diff)
downloadblog-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/namespace/ORM')
-rw-r--r--core/namespace/ORM/Entity.php1
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);