prepare($query); $stmt->execute($params); return $stmt->fetchObject($output); } } abstract class BaseModel { protected static $sql = null; public static function Get(int $id) { self::Initialize(); return ConnectionManager::Query( self::$sql->Get(), [], get_called_class()); } abstract private static function Initialize(); } class JobSql implements ISqlBase { public function Get(): string { return "Select * from jobs where id = :id"; } } class Job extends BaseModel { public static function Initialize() { if (self::$sql === null) { self::$sql = new JobSql(); } } } $dns = 'pgsql:host=localhost;port=5432;dbname=dynamic_dev;user=test;password=pass123'; ConnectionManager::Connect($dns); echo " "; var_dump(Job::Get(10)); echo " ";