yghhg
This commit is contained in:
parent
f7e35dee68
commit
49760a09bf
|
@ -7,7 +7,7 @@ interface ISqlBase {
|
||||||
//public function Delete(): string;
|
//public function Delete(): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class BaseModel {
|
abstract class BaseModel {
|
||||||
protected $sql;
|
protected $sql;
|
||||||
|
|
||||||
public function __construct(ISqlBase $sql) {
|
public function __construct(ISqlBase $sql) {
|
||||||
|
@ -15,7 +15,7 @@ class BaseModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function Get(int $id) {
|
public static function Get(int $id) {
|
||||||
return self::class;
|
return get_class($this);
|
||||||
$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__);
|
||||||
|
|
Loading…
Reference in New Issue