From 1bc4dc0f2aab43cc527fe449b2e2701abab35d1b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 1 Apr 2021 12:26:22 +0300 Subject: Moved static functionality of Company and JobOffer below the dynamic one --- src/models/Company.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/models/Company.php') diff --git a/src/models/Company.php b/src/models/Company.php index 02d073c..0fa72d8 100644 --- a/src/models/Company.php +++ b/src/models/Company.php @@ -2,17 +2,21 @@ include_once("DBModel.php"); class Company extends DBModel { - public const TABLE_NAME = "companies"; - public const TABLE_COLUMNS = array( - "name " . DB::STRING_TYPE, - ); - public string $name; function __construct(string $name) { $this->name = $name; } + /* + * Everything from here is static functionality + */ + + public const TABLE_NAME = "companies"; + public const TABLE_COLUMNS = array( + "name " . DB::STRING_TYPE, + ); + static function __constructStatic() { self::$DB->createTable(self::TABLE_NAME, self::TABLE_COLUMNS); } -- cgit v1.3.1-23-gd82d