Add weekly progress and validation
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
class Category
|
||||
{
|
||||
@@ -8,4 +8,12 @@ class Category
|
||||
->query('SELECT id, name, color FROM categories ORDER BY name')
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
public static function exists(int $id): bool
|
||||
{
|
||||
$statement = Database::connection()->prepare('SELECT id FROM categories WHERE id = :id LIMIT 1');
|
||||
$statement->execute(['id' => $id]);
|
||||
|
||||
return (bool) $statement->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user