Helper class to export custom text phrases as CSV/JSON from the DB.
More...
Helper class to export custom text phrases as CSV/JSON from the DB.
Definition at line 21 of file CustomTextExport.php.
◆ __construct()
| Fossology\Lib\Application\CustomTextExport::__construct |
( |
DbManager |
$dbManager | ) |
|
Constructor
- Parameters
-
| DbManager | $dbManager | DB manager to use. |
Definition at line 37 of file CustomTextExport.php.
◆ arrayToCsvLine()
| Fossology\Lib\Application\CustomTextExport::arrayToCsvLine |
( |
|
$array | ) |
|
|
private |
Convert array to CSV line.
- Parameters
-
| array | $array | Array to convert |
- Returns
- string CSV line
Definition at line 178 of file CustomTextExport.php.
◆ createCsvContent()
| Fossology\Lib\Application\CustomTextExport::createCsvContent |
( |
|
$result | ) |
|
|
private |
Create CSV content from result array.
- Parameters
-
| array | $result | Database result array |
- Returns
- string CSV content
Definition at line 110 of file CustomTextExport.php.
◆ createJson()
| Fossology\Lib\Application\CustomTextExport::createJson |
( |
|
$result | ) |
|
|
private |
Create JSON content from result array.
- Parameters
-
| array | $result | Database result array |
- Returns
- string JSON content
Definition at line 152 of file CustomTextExport.php.
◆ export()
| Fossology\Lib\Application\CustomTextExport::export |
( |
|
$cp_pk = 0, |
|
|
|
$generateJson = false |
|
) |
| |
Create the CSV/JSON export from the DB.
- Parameters
-
| int | $cp_pk | Set the custom phrase ID to get only one phrase, set 0 to get all |
| bool | $generateJson | Whether to generate JSON format instead of CSV |
- Returns
- string csv or json content
Definition at line 66 of file CustomTextExport.php.
◆ setDelimiter()
| Fossology\Lib\Application\CustomTextExport::setDelimiter |
( |
|
$delimiter = ',' | ) |
|
Update the delimiter.
- Parameters
-
| string | $delimiter | New delimiter to use. |
Definition at line 46 of file CustomTextExport.php.
◆ setEnclosure()
| Fossology\Lib\Application\CustomTextExport::setEnclosure |
( |
|
$enclosure = '"' | ) |
|
Update the enclosure.
- Parameters
-
| string | $enclosure | New enclosure to use. |
Definition at line 55 of file CustomTextExport.php.
◆ $dbManager
| DbManager Fossology\Lib\Application\CustomTextExport::$dbManager |
|
protected |
◆ $delimiter
| string Fossology\Lib\Application\CustomTextExport::$delimiter = ',' |
|
protected |
◆ $enclosure
| string Fossology\Lib\Application\CustomTextExport::$enclosure = '"' |
|
protected |
The documentation for this class was generated from the following file: