aboutsummaryrefslogtreecommitdiffstats
path: root/core/namespace/Entity.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-06-25 22:13:59 +0200
committerThomas Lange <code@nerdmind.de>2021-06-25 22:13:59 +0200
commita86bdc6b5bab78b4026f44161413f4e482df42e4 (patch)
tree76ffd745780671371272e97b3eeac85e154e236e /core/namespace/Entity.php
parent366d0de19c012821ef587d5fdb9557c339b43303 (diff)
downloadblog-a86bdc6b5bab78b4026f44161413f4e482df42e4.tar.gz
blog-a86bdc6b5bab78b4026f44161413f4e482df42e4.tar.xz
blog-a86bdc6b5bab78b4026f44161413f4e482df42e4.zip
Reorganize namespaces
Diffstat (limited to 'core/namespace/Entity.php')
-rw-r--r--core/namespace/Entity.php47
1 files changed, 0 insertions, 47 deletions
diff --git a/core/namespace/Entity.php b/core/namespace/Entity.php
deleted file mode 100644
index 4bedd37..0000000
--- a/core/namespace/Entity.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-abstract class Entity implements EntityInterface {
- protected $id;
- protected $time_insert;
- protected $time_update;
-
- #===============================================================================
- # Get attribute
- #===============================================================================
- public function get(string $attribute) {
- return $this->{$attribute} ?? NULL;
- }
-
- #===============================================================================
- # Set attribute
- #===============================================================================
- public function set(string $attribute, $value) {
- return $this->{$attribute} = $value;
- }
-
- #===============================================================================
- # Return ID
- #===============================================================================
- final public function getID(): int {
- return $this->id;
- }
-
- #===============================================================================
- # Get all attributes
- #===============================================================================
- public function getAll(array $exclude = []): array {
- $attributes = get_object_vars($this);
-
- return array_filter($attributes, function($attribute) use($exclude) {
- return !in_array($attribute, $exclude);
- }, ARRAY_FILTER_USE_KEY);
- }
-
- #===============================================================================
- # Get array with all non-false attributes
- #===============================================================================
- public function getFilteredAttributes(): array {
- return array_filter(get_object_vars($this), function($value) {
- return $value !== FALSE;
- });
- }
-}