ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCSVWriter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilCSVWriter:

Public Member Functions

 setSeparator (string $a_sep)
 
 setDelimiter (string $a_del)
 
 addRow ()
 
 addColumn (string $a_col)
 
 getCSVString ()
 

Private Member Functions

 quote (string $a_str)
 

Private Attributes

string $csv = ''
 
string $separator = ','
 
string $delimiter = '"'
 
string $new_line = "\n"
 
bool $first_entry = true
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilCSVWriter.php.

Member Function Documentation

◆ addColumn()

ilCSVWriter::addColumn ( string  $a_col)

Definition at line 43 of file class.ilCSVWriter.php.

43 : void
44 {
45 if (!$this->first_entry) {
46 $this->csv .= $this->separator;
47 }
48 $this->csv .= $this->delimiter;
49 $this->csv .= $this->quote($a_col);
50 $this->csv .= $this->delimiter;
51 $this->first_entry = false;
52 }
quote(string $a_str)

References $delimiter, $separator, and quote().

Referenced by ilBookingReservationsTableGUI\fillHeaderCSV(), ilSCORM2004TrackingItemsTableGUI\fillHeaderCSV(), ilSCORMTrackingItemsTableGUI\fillHeaderCSV(), ilSumScoreTableGUI\fillHeaderCSV(), ilTable2GUI\fillHeaderCSV(), ilLPProgressTableGUI\fillHeaderCSV(), ilTrMatrixTableGUI\fillHeaderCSV(), ilTrObjectUsersPropsTableGUI\fillHeaderCSV(), ilTrSummaryTableGUI\fillHeaderCSV(), ilTrUserObjectsPropsTableGUI\fillHeaderCSV(), ilLPTableBaseGUI\fillMetaCSV(), ILIAS\MyStaff\ListCertificates\ilMStListCertificatesTableGUI\fillRowCSV(), ILIAS\MyStaff\ListCompetences\Skills\ilMStListCompetencesSkillsTableGUI\fillRowCSV(), ILIAS\MyStaff\ListUsers\ilMStListUsersTableGUI\fillRowCSV(), ilBookingReservationsTableGUI\fillRowCSV(), ilMStListCoursesTableGUI\fillRowCSV(), ilMStShowUserCoursesTableGUI\fillRowCSV(), ilPollAnswerTableGUI\fillRowCSV(), ilPollUserTableGUI\fillRowCSV(), ilSCORM2004TrackingItemsTableGUI\fillRowCSV(), ilSCORMTrackingItemsTableGUI\fillRowCSV(), ilSumScoreTableGUI\fillRowCSV(), ilTable2GUI\fillRowCSV(), ilLPObjectStatisticsDailyTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrSummaryTableGUI\fillRowCSV(), and ilTrUserObjectsPropsTableGUI\fillRowCSV().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addRow()

◆ getCSVString()

ilCSVWriter::getCSVString ( )

Definition at line 54 of file class.ilCSVWriter.php.

54 : string
55 {
56 return $this->csv;
57 }

References $csv.

◆ quote()

ilCSVWriter::quote ( string  $a_str)
private

Definition at line 59 of file class.ilCSVWriter.php.

59 : string
60 {
61 return str_replace(
62 $this->delimiter,
63 $this->delimiter . $this->delimiter,
64 $a_str
65 );
66 }

Referenced by addColumn().

+ Here is the caller graph for this function:

◆ setDelimiter()

ilCSVWriter::setDelimiter ( string  $a_del)

Definition at line 32 of file class.ilCSVWriter.php.

32 : void
33 {
34 $this->delimiter = $a_del;
35 }

◆ setSeparator()

ilCSVWriter::setSeparator ( string  $a_sep)

Definition at line 27 of file class.ilCSVWriter.php.

27 : void
28 {
29 $this->separator = $a_sep;
30 }

Field Documentation

◆ $csv

string ilCSVWriter::$csv = ''
private

Definition at line 21 of file class.ilCSVWriter.php.

Referenced by getCSVString().

◆ $delimiter

string ilCSVWriter::$delimiter = '"'
private

Definition at line 23 of file class.ilCSVWriter.php.

Referenced by addColumn().

◆ $first_entry

bool ilCSVWriter::$first_entry = true
private

Definition at line 25 of file class.ilCSVWriter.php.

◆ $new_line

string ilCSVWriter::$new_line = "\n"
private

Definition at line 24 of file class.ilCSVWriter.php.

Referenced by addRow().

◆ $separator

string ilCSVWriter::$separator = ','
private

Definition at line 22 of file class.ilCSVWriter.php.

Referenced by addColumn().


The documentation for this class was generated from the following file: