This commit is contained in:
Michał Sieciechowicz 2021-02-26 22:10:22 +01:00
parent 49760a09bf
commit 4dda06bc5f
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ abstract class BaseModel {
} }
public static function Get(int $id) { public static function Get(int $id) {
return get_class($this); return get_called_class();
$stmt = $pdo->prepare('SELECT id, name FROM users WHERE id=?'); $stmt = $pdo->prepare('SELECT id, name FROM users WHERE id=?');
$stmt->execute([$id]); $stmt->execute([$id]);
return $stmt->fetchObject(__CLASS__); return $stmt->fetchObject(__CLASS__);