From b39c293b971f891785f421adc4072a4520504b76 Mon Sep 17 00:00:00 2001 From: Sieciech Date: Sat, 27 Feb 2021 09:35:47 +0100 Subject: [PATCH] init --- index.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index d0d6ffc..f30b87b 100644 --- a/index.php +++ b/index.php @@ -43,15 +43,13 @@ class JobSql implements ISqlBase { public function Get(): string { return "Select * from jobs where id = :id"; } - public static function Create() { - return new Job(); - } } class Job extends BaseModel { - private static $sql = JobSql::Create(); - public function __construct() { - parent::__construct( new JobSql() ); + 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';