From e3f05b25f961e0169185acabd32566e2ae5198fe Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 10 Aug 2021 17:42:11 +0200 Subject: Add a better mechanism to detect Entity changes Implement and use a better mechanism to detect changes of attributes of the Entity objects by using a private variable which keeps track of the changed Entity attributes ("properties") via the "set" method. The "insert" and "update" method of the Repository now calls the method "getModifiedKeys" of the Entity class to get a list of properties which have been changed and builds the database query accordingly. This makes the use of "FALSE" as default value for the Entity attributes obsolete, so they have been set to the initial PHP default ("NULL"). --- core/namespace/ORM/Entities/User.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'core/namespace/ORM/Entities/User.php') diff --git a/core/namespace/ORM/Entities/User.php b/core/namespace/ORM/Entities/User.php index 65d5345..78e03db 100644 --- a/core/namespace/ORM/Entities/User.php +++ b/core/namespace/ORM/Entities/User.php @@ -3,11 +3,11 @@ namespace ORM\Entities; use ORM\Entity; class User extends Entity { - protected $slug = FALSE; - protected $username = FALSE; - protected $password = FALSE; - protected $fullname = FALSE; - protected $mailaddr = FALSE; - protected $body = FALSE; - protected $argv = FALSE; + protected $slug; + protected $username; + protected $password; + protected $fullname; + protected $mailaddr; + protected $body; + protected $argv; } -- cgit v1.2.3