WIP Contract/Billing 2024-06-20
This commit is contained in:
@@ -34,28 +34,14 @@ class AddresstypeModel {
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
public static function getOne($id) {
|
||||
if(!is_numeric($id) || !$id) {
|
||||
throw new Exception("Invalid number", 400);
|
||||
}
|
||||
$item = [];
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select($this->table, "*", "id=$id LIMIT 1");
|
||||
if($db->num_rows($res)) {
|
||||
$data = $db->fetch_object($res);
|
||||
$item = new Addresstype($data);
|
||||
}
|
||||
return $item;
|
||||
}
|
||||
|
||||
|
||||
public static function getAll() {
|
||||
$items = [];
|
||||
|
||||
$db = FronkDB::singleton();
|
||||
|
||||
$res = $db->select($this->table, "*");
|
||||
$res = $db->select("Addresstype", "*");
|
||||
if($db->num_rows($res)) {
|
||||
while($data = $db->fetch_object($res)) {
|
||||
$items[] = new Addresstype($data);
|
||||
|
||||
Reference in New Issue
Block a user