diff options
| Commit | fb2645d444729d656a209ef586a13fb569429280 (patch) | |
|---|---|---|
| Author | 2021-04-03 18:27:33 +0300 | |
| Committer | 2021-04-03 18:27:33 +0300 | |
| Files | 91daafcdb8af6cd41551bbf442f4be77dee575a4 /src/models/Company.php | |
| devrix-job-board-1.0.tar devrix-job-board-1.0.tar.gz devrix-job-board-1.0.zip | ||
| Parent | 67bc860ea4b3db5033a42038ab86d0df955c9295 (diff) | |
| Parent | 3b0cbc90e3046a8bb979c2b9a17fae5a94bb2707 (diff) | |
Merge pull request #3 from Syndamia/dev v1.0
Exam version finished
1 files changed, 10 insertions, 3 deletions
| -rw-r--r-- | src/models/Company.php | 13 |
diff --git a/src/models/Company.php b/src/models/Company.php index 1dfb05e..58b1734 100644 --- a/src/models/Company.php +++ b/src/models/Company.php @@ -1,5 +1,5 @@ <?php -include_once("models/DBModel.php"); +include_once('models/DBModel.php'); class Company extends DBModel { public string $name; @@ -12,13 +12,20 @@ class Company extends DBModel { * Everything from here is static functionality */ - public const TABLE_NAME = "companies"; + public const TABLE_NAME = 'companies'; static function __constructStatic() { $columns = array( - "name " . DB::STRING_TYPE, + 'name ' . DB::STRING_TYPE, ); self::$DB->createTable(self::TABLE_NAME, $columns); + + // Since there is no real way to add companies, this serves as the only official way. + if (sizeof(self::getAllFromDB()) == 0) { + self::insertIntoDB(new Company("MegaCorp")); + self::insertIntoDB(new Company("Cool INC.")); + self::insertIntoDB(new Company("Company Awesome Ltd.")); + } } /* Create */ |
