PendingApplications::pendingApplicationsCSV PHP Méthode

pendingApplicationsCSV() protected méthode

Generates and returns a CSV containing all pending therapy applications.
protected pendingApplicationsCSV ( ) : string
Résultat string
    protected function pendingApplicationsCSV()
    {
        $lines = $this->getPendingApplications();
        if (!count($lines)) {
            return '';
        }
        $handle = fopen('php://memory', 'w');
        $header = false;
        foreach ($lines as $line) {
            if (!$header) {
                fputcsv($handle, array_keys($line));
                $header = true;
            }
            fputcsv($handle, $line);
        }
        fseek($handle, 0);
        return stream_get_contents($handle);
    }