diff options
Moved static functionality of Company and JobOffer below the dynamic one
1 files changed, 9 insertions, 5 deletions
| -rw-r--r-- | src/models/Company.php | 14 |
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); } |
