sql = $sql; } public static function Get(int $id) { return get_called_class(); $stmt = $pdo->prepare('SELECT id, name FROM users WHERE id=?'); $stmt->execute([$id]); return $stmt->fetchObject(__CLASS__); } } class JobSql implements ISqlBase { public function Get(): string { return ""; } } class Job extends BaseModel { public function __construct() { parent::__construct( new JobSql() ); } } echo " "; echo Job::Get(10); echo " ";