comments in controllers hinzugefügt + review + testing
This commit is contained in:
Regular → Executable
+4
-1
@@ -31,6 +31,7 @@ class Reminder
|
||||
return $statement->fetchAll();
|
||||
}
|
||||
|
||||
// Legt eine Erinnerung an
|
||||
public static function createForHabit(int $habitId, int $userId, array $data): bool
|
||||
{
|
||||
$statement = Database::connection()->prepare(
|
||||
@@ -50,6 +51,7 @@ class Reminder
|
||||
return $statement->rowCount() === 1;
|
||||
}
|
||||
|
||||
// Aktualisiert eine Erinnerung
|
||||
public static function update(int $id, int $userId, array $data): bool
|
||||
{
|
||||
$statement = Database::connection()->prepare(
|
||||
@@ -82,6 +84,7 @@ class Reminder
|
||||
return $statement->execute(['id' => $id, 'user_id' => $userId]);
|
||||
}
|
||||
|
||||
// Schaltet zwischen aktiv und pausiert um
|
||||
public static function toggle(int $id, int $userId): bool
|
||||
{
|
||||
$statement = Database::connection()->prepare(
|
||||
@@ -93,4 +96,4 @@ class Reminder
|
||||
|
||||
return $statement->execute(['id' => $id, 'user_id' => $userId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user