true)); $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING); $dbh->beginTransaction(); $query = "INSERT INTO pali_text ( id , book , paragraph, level, toc, chapter_len , parent ) VALUES ( ? , ? , ? , ? , ? , ? , ? )"; try{ $stmt = $dbh->prepare($query); }catch(PDOException $e){ Log::info($e); return 1; } $bar = $this->output->createProgressBar(PaliText::count()); foreach (PaliText::select(['uid','book','paragraph', 'level','toc','lenght','chapter_len', 'next_chapter','prev_chapter','parent','chapter_strlen']) ->orderBy('book') ->orderBy('paragraph') ->cursor() as $chapter) { $currData = array( $chapter->uid, $chapter->book, $chapter->paragraph, $chapter->level, $chapter->toc, $chapter->chapter_len, $chapter->parent, ); $stmt->execute($currData); $bar->advance(); } $dbh->commit(); $bar->finish(); Log::debug('task: export offline palitext-table finished'); return 0; } }