comments in models hinzugefügt

This commit is contained in:
arslandevelopments
2026-08-19 13:55:51 +02:00
parent b4811f4bd0
commit 6e1dcd9d1c
2 changed files with 5 additions and 2 deletions
Regular → Executable
+1
View File
@@ -49,6 +49,7 @@ class Habit
return $habit ?: null;
}
// Legt einen neuen Habit an
public static function create(int $userId, array $data): bool
{
$sql = 'INSERT INTO habits (user_id, category_id, title, description, target_per_week)
Regular → Executable
+2
View File
@@ -2,6 +2,7 @@
class User
{
// Legt einen neuen Benutzer an
public static function create(string $name, string $email, string $password): bool
{
$sql = 'INSERT INTO users (name, email, password_hash) VALUES (:name, :email, :password_hash)';
@@ -14,6 +15,7 @@ class User
]);
}
// Sucht einen Benutzer anhand der E-Mail
public static function findByEmail(string $email): ?array
{
$statement = Database::connection()->prepare('SELECT * FROM users WHERE email = :email LIMIT 1');