public function executeExportflashcards() { $throttler = new RequestThrottler($this->getUser(), 'export'); if (!$throttler->isValid()) { return $this->renderPartial('misc/requestThrottleError'); } $csv = new ExportCSV($this->getContext()->getDatabase()); $select = ReviewsPeer::getSelectForExport($this->getUser()->getUserId()); $csvText = $csv->export($select, array('FrameNumber', 'Kanji', 'Keyword', 'LastReview', 'ExpireDate', 'LeitnerBox', 'FailCount', 'PassCount'), array('col_escape' => array(0, 1, 1, 0, 0, 0, 0, 0))); $throttler->setTimeout(); $this->getResponse()->setFileAttachmentHeaders('rtk_flashcards.csv'); $this->setLayout(false); return $this->renderText($csvText); }