/** * Generates proforma invoice for order and returns it's file path * * @param Order $order * * @return string absolute filepath */ public function generate(Order $order) { $outputFile = $this->getFilePath($order); vBuilder\Utils\FileSystem::createFilePath($outputFile); $orderInvoice = new vStore\Invoicing\ShopOrderInvoice($order); $this->renderer->renderToFile($orderInvoice, $outputFile); return $outputFile; }
$sql .= "COMMIT;\n"; if (file_put_contents($file, $sql) === FALSE) { throw new Nette\IOException("Cannot write to file '{$file}'"); } } // ----------------------------------------------------------------------------- // DB // ----------------------------------------------------------------------------- $existingTables = $db->getDatabaseInfo()->getTableNames(); foreach ($existingTables as $table) { // Get script file paths $dumpPaths = array('structure' => $tm->getDdlScript($table), 'data' => $tm->getDataScript($table)); // Create parent directories foreach ($dumpPaths as $path) { if ($path) { FileSystem::createFilePath($path); } } $relPath = FileSystem::getRelativePath($workPath, $dumpPaths['structure']); echo "\n[1;36m{$table}[0m in [0;36m{$relPath}[0m: "; switch (dumpStructure($db, $table, $dumpPaths['structure'])) { case 0: echo "ok"; break; case 1: echo "created"; break; case 2: echo "updated"; break; }