aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Entity/Registration.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2024-11-27 19:18:12 +0100
committerHarald Eilertsen <haraldei@anduin.net>2025-06-29 13:25:20 +0200
commit91203660852d3f4376e14fb8733a0a9bdb1bd151 (patch)
tree7c61e6990b9c40561acbaadfc801bb3cfc0cfce1 /Zotlabs/Entity/Registration.php
parent07c2cca55c5ae1f14ae9a4e6058844ed5a0ca406 (diff)
downloadvolse-hubzilla-module-admin-accounts-enhancements-continued.tar.gz
volse-hubzilla-module-admin-accounts-enhancements-continued.tar.bz2
volse-hubzilla-module-admin-accounts-enhancements-continued.zip
Move database query out of Entity\Registration.module-admin-accounts-enhancements-continued
This introduces a wrapper class Zotlabs\Data\Registration, that handled the interaction with the database, and that will _own_ the entity. With this model entities will not be handled directly by the user code, but we still get the separation between the business logic (in the entity) and the database related code. The only thing that bothers me is that we now have classes with the same name in both the Entity and the Data subnamespaces. This is fixable, however, but could cause some confustion right now.
Diffstat (limited to 'Zotlabs/Entity/Registration.php')
-rw-r--r--Zotlabs/Entity/Registration.php17
1 files changed, 0 insertions, 17 deletions
diff --git a/Zotlabs/Entity/Registration.php b/Zotlabs/Entity/Registration.php
index d210f4d39..e2af8e22b 100644
--- a/Zotlabs/Entity/Registration.php
+++ b/Zotlabs/Entity/Registration.php
@@ -53,23 +53,6 @@ class Registration
}
/**
- * Find a registration by it's hash.
- *
- * @param string $hash The hash of the registration to find.
- *
- * @return Registration|null An initialized Registration object
- * if the registration was found, null otherwise.
- */
- public static function find_by_hash(string $hash): ?self
- {
- $reg = q("SELECT * FROM register WHERE reg_hash = '%s' LIMIT 1",
- dbesc($hash)
- );
-
- return $reg ? new self($reg[0], true) : null;
- }
-
- /**
* Set the value of a property.
*
* @param string $name The name of the property, optionally prefixed by `reg_`.