private static function buildSharedTicket($dbRow, $pdo) { $db = DB::get(); $tkt = SharedTicket::__build($dbRow['ID'], $dbRow['NAME'], $dbRow['CUSTOMER_ID'], $dbRow['CUSTCOUNT'], $dbRow['TARIFFAREA_ID'], $dbRow['DISCOUNTPROFILE_ID'], $dbRow['DISCOUNTRATE']); $id = $dbRow['ID']; // Get lines $lines = array(); $lineSql = "SELECT * FROM SHAREDTICKETLINES WHERE " . "SHAREDTICKET_ID = :id ORDER BY LINE"; $lineStmt = $pdo->prepare($lineSql); $lineStmt->bindParam(":id", $id); $lineStmt->execute(); while ($rowLine = $lineStmt->fetch()) { $line = SharedTicketLines::__build($rowLine['ID'], $rowLine['SHAREDTICKET_ID'], $rowLine['LINE'], $rowLine['PRODUCT_ID'], $rowLine['TAX_ID'], $rowLine['QUANTITY'], $rowLine['DISCOUNTRATE'], $rowLine['PRICE'], $db->readBin($rowLine['ATTRIBUTES'])); $tkt->addProduct($line); } return $tkt; }
private function createSharedTicketLines($sharedTicketId) { $ret = array(); $ret[] = SharedTicketLines::__build(1, $sharedTicketId, 0, $this->prd->id, $this->tax->id, 1, 0, 10.34, null); $ret[] = SharedTicketLines::__build(2, $sharedTicketId, 1, $this->prd2->id, $this->tax->id, 1, 0, 10.34, null); return $ret; }