diff options
| Commit | f8c1df9a9a24be0ff3811dc33e00f92bf51465ab (patch) | |
|---|---|---|
| Author | 2021-04-03 11:54:52 +0300 | |
| Committer | 2021-04-03 11:54:52 +0300 | |
| Files | 56dfbe9d57e3150b480928da543b3dba30e11692 /src/models/DBModel.php | |
| devrix-job-board-0.1.tar devrix-job-board-0.1.tar.gz devrix-job-board-0.1.zip | ||
| Parent | aa2e361c3114b53ac7858e118454b9dfaf51ebe4 (diff) | |
| Parent | fff8c08ad7f3845eb32671292392cbf08bb738c9 (diff) | |
Merge pull request #1 from Syndamia/dev v0.1
Implemented main functionality
1 files changed, 21 insertions, 0 deletions
| -rw-r--r-- | src/models/DBModel.php | 21 |
diff --git a/src/models/DBModel.php b/src/models/DBModel.php new file mode 100644 index 0000000..4e10c18 --- /dev/null +++ b/src/models/DBModel.php @@ -0,0 +1,21 @@ +<?php +include_once("DB.php"); + +/** + * A class, mainly for holding the static DB class intance. You can also get your model id from here. + */ +abstract class DBModel { + /** + * Used ONLY for gotten values form the database. Must not be assigned to, since it is AUTO_INCREMENT. + * The id column is set by default in the DB class. + */ + public int $id; + + protected static DB $DB; + + public static function __constructStatic() { + self::$DB = new DB(); + } +} + +DBModel::__constructStatic(); |
