From 9f23c3963285960ec4d30fe7b25730da1125b4a4 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 1 Apr 2021 09:13:53 +0300 Subject: Updated JobOffer to initialise it's own db table --- src/models/DBModel.php | 2 +- src/models/JobOffer.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/models') diff --git a/src/models/DBModel.php b/src/models/DBModel.php index 65bb725..6980446 100644 --- a/src/models/DBModel.php +++ b/src/models/DBModel.php @@ -2,7 +2,7 @@ include_once("DB.php"); abstract class DBModel { - protected static $DB; + protected static DB $DB; public static function __constructStatic() { self::$DB = new DB(); diff --git a/src/models/JobOffer.php b/src/models/JobOffer.php index d4268db..5cd6de4 100644 --- a/src/models/JobOffer.php +++ b/src/models/JobOffer.php @@ -15,5 +15,7 @@ class JobOffer extends DBModel { $this->description = $description; $this->company = $company; $this->salary = $salary; + + self::$DB->createTable(self::TABLE_NAME, self::TABLE_COLUMNS); } } -- cgit v1.3.1-26-gb76a