diff options
Moved static functionality of Company and JobOffer below the dynamic one
1 files changed, 12 insertions, 8 deletions
| -rw-r--r-- | src/models/JobOffer.php | 20 |
diff --git a/src/models/JobOffer.php b/src/models/JobOffer.php index 555e7f4..3ec4b77 100644 --- a/src/models/JobOffer.php +++ b/src/models/JobOffer.php @@ -6,14 +6,6 @@ include_once("Company.php"); * Model that contains the required JobOffer properties. It also contains the request methods to the job_offers table. */ class JobOffer extends DBModel { - public const TABLE_NAME = "job_offers"; - public const TABLE_COLUMNS = array( - "title " . DB::STRING_TYPE, - "description " . DB::STRING_TYPE, - "companyId " . DB::INTEGER_TYPE, // Requires a foreign key - "salary " . DB::FLOAT_TYPE, - ); - public string $title; public string $description; public int $companyId; @@ -26,6 +18,18 @@ class JobOffer extends DBModel { $this->salary = $salary; } + /* + * Everything from here is static functionality + */ + + public const TABLE_NAME = "job_offers"; + public const TABLE_COLUMNS = array( + "title " . DB::STRING_TYPE, + "description " . DB::STRING_TYPE, + "companyId " . DB::INTEGER_TYPE, // Requires a foreign key + "salary " . DB::FLOAT_TYPE, + ); + static function __constructStatic() { $foreignKeys = array( DB::genFK("companyId", Company::TABLE_NAME, "id") |
