public function actionToday() { $fileName = sprintf("%s-%s", "barry-export-data", date("Y-m-d")); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"{$fileName}.csv\";"); header("Content-Transfer-Encoding: binary"); $barryOptOutLogs = new BarryOptLog(); $allDataColl = $barryOptOutLogs->getAllToday(); $exporter = new ExportLeadData(); $filePath = $exporter->exportContents($allDataColl); /*stream the contents*/ echo file_get_contents($filePath); }
public static function getCountToday() { $obj = new BarryOptLog(); $resColl = $obj->getAllToday(); return count($resColl); }