Example #1
0
 public static function get($x)
 {
     $sql = "SELECT * FROM invoices where invoiceID = :x";
     $row = DB::SelectOne($sql, ["x" => $x]);
     $invoice = new Invoice();
     $invoice->id = $row->invoiceID;
     $invoice->date = $row->invoiceDate;
     $invoice->customer = $row->customer;
     // I really want an array of items here....
     /// How could i possibly fetch the items for just this inovice id????
     $invoice->tools = Tool::getByInvoiceId($x);
     $invoice->calcTotal();
     return $invoice;
 }