Use bool values in database

This commit is contained in:
2025-12-17 21:41:00 +09:00
parent bb5b013d31
commit 1eabf809f0
6 changed files with 21 additions and 21 deletions

View File

@@ -78,7 +78,7 @@ class Door {
$query = 'INSERT INTO door(time, open) VALUES (:time, :open)';
$statement = $this->pdo->prepare($query);
$statement->bindParam(':time', $time, \PDO::PARAM_STR);
$statement->bindParam(':open', $open, \PDO::PARAM_STR);
$statement->bindParam(':open', $open, \PDO::PARAM_BOOL);
$statement->execute();
$this->removeOld();

View File

@@ -25,7 +25,7 @@ class ProjectManager {
$dbProj['id'],
$dbProj['name'],
$dbProj['description'],
$dbProj['active'],
(bool) $dbProj['active'],
);
$projects[] = $project;
}
@@ -48,7 +48,7 @@ class ProjectManager {
$dbProj['id'],
$dbProj['name'],
$dbProj['description'],
$dbProj['active'],
(bool) $dbProj['active'],
);
}
@@ -76,7 +76,7 @@ class ProjectManager {
$dbProj['id'],
$dbProj['name'],
$dbProj['description'],
$dbProj['active'],
(bool) $dbProj['active'],
);
$projects[] = $project;
}
@@ -101,8 +101,8 @@ class ProjectManager {
'uname' => $dbUsr['uname'],
'mail' => $dbUsr['mail'],
'role' => $dbUsr['role'],
'lead' => $dbUsr['lead'],
'owner' => $dbUsr['owner'],
'lead' => (bool) $dbUsr['lead'],
'owner' => (bool) $dbUsr['owner'],
];
}
@@ -125,8 +125,8 @@ class ProjectManager {
'uname' => $dbOwner['uname'],
'mail' => $dbOwner['mail'],
'role' => $dbOwner['role'],
'lead' => $dbOwner['lead'],
'owner' => $dbOwner['owner'],
'lead' => (bool) $dbOwner['lead'],
'owner' => (bool) $dbOwner['owner'],
];
}
}