Specify a few column types

This commit is contained in:
Skylar Ittner 2020-06-26 20:28:37 -06:00
parent a7cd0db9a0
commit 5d9db66a2f
3 changed files with 3 additions and 3 deletions

Binary file not shown.

View File

@ -15,7 +15,7 @@ class Component implements JsonSerializable {
$this->componentid = $componentid;
if (Component::exists($componentid)) {
$this->exists = true;
$this->component = $database->get("components", ["machineid", "serial", "typeid", "tested", "capacity", "model", "price", "manufacturer", "publicnotes", "privatenotes"], ["compid" => $componentid]);
$this->component = $database->get("components", ["machineid", "serial", "typeid [Int]", "tested", "capacity", "model", "price [Number]", "manufacturer", "publicnotes", "privatenotes"], ["compid" => $componentid]);
}
}

View File

@ -20,8 +20,8 @@ class Machine implements JsonSerializable {
$this->machineid = $machineid;
if (Machine::exists($machineid)) {
$this->exists = true;
$this->machine = $database->get('machines', ['type', 'model', 'condition', 'price', 'os', 'serial', 'manufacturer', 'clientid', 'privatenotes', 'publicnotes'], ['machineid' => $machineid]);
$typeinfo = $database->get("machine_types", ["machinetypeid (id)", "typename (label)", "icon"], ["machinetypeid" => $this->machine["type"]]);
$this->machine = $database->get('machines', ['type [Int]', 'model', 'condition [Number]', 'price [Number]', 'os', 'serial', 'manufacturer', 'clientid [Int]', 'privatenotes', 'publicnotes'], ['machineid' => $machineid]);
$typeinfo = $database->get("machine_types", ["machinetypeid (id) [Int]", "typename (label)", "icon"], ["machinetypeid" => $this->machine["type"]]);
$this->icon = $typeinfo["icon"];
$this->typeid = $typeinfo["id"];
$this->typelabel = $typeinfo["label"];