Summary Files Commits Branches @commit @diff @stats
path: root / src / models / DBModel.php
blob: a9f931c63d2b5e2685a44dfb34a91931fb847af4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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();