DAO 修正

This commit is contained in:
2024-02-12 13:00:15 +09:00
parent 1ae5df5420
commit dd3a9027d5
3 changed files with 21 additions and 4 deletions
+9
View File
@@ -51,6 +51,15 @@ Thread
} }
public static function
find (
int $id)
: \Dto\Thread
{
;
}
public static function public static function
create_thread ( create_thread (
SQLite3 $db, SQLite3 $db,
+7
View File
@@ -0,0 +1,7 @@
<?php
require_once __DIR__ . '/daos/response.php';
require_once __DIR__ . '/daos/thread.php';
require_once __DIR__ . '/dtos/response.php';
require_once __DIR__ . '/dtos/thread.php';
+5 -4
View File
@@ -1,6 +1,7 @@
<?php <?php
use \Dao; require_once __DIR__ . '/../import.php';
use \Dto; use \Dto;
@@ -28,7 +29,7 @@ else
$dir = './images/'; $dir = './images/';
$handle = opendir ($dir); $handle = opendir ($dir);
if ($row = Dao\Thread :: find ($thread)) if ($row = \Dao\Thread :: find ($thread))
{ {
$title = $row -> title; $title = $row -> title;
$explain = $row -> explain; $explain = $row -> explain;
@@ -38,13 +39,13 @@ if (isset ($_GET['id']))
{ {
if (($_GET['evaluate'] ?? '') === 'good') if (($_GET['evaluate'] ?? '') === 'good')
{ {
Dao\Response :: like ((int) $_GET['id']); \Dao\Response :: like ((int) $_GET['id']);
header ("Location: ./?thread=$thread&sort=$sort"); header ("Location: ./?thread=$thread&sort=$sort");
} }
if (($_GET['evaluate'] ?? '') === 'bad') if (($_GET['evaluate'] ?? '') === 'bad')
{ {
Dao\Response :: dislike ((int) $_GET['id']); \Dao\Response :: dislike ((int) $_GET['id']);
header ("Location: ./?thread=$thread&sort=$sort"); header ("Location: ./?thread=$thread&sort=$sort");
} }
} }