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 207 of file CustomTextExport.php.
◆ createCsvContent()
| Fossology\Lib\Application\CustomTextExport::createCsvContent |
( |
|
$phrases | ) |
|
|
private |
Create CSV content from result array.
- Parameters
-
| array | $result | Database result array |
- Returns
- string CSV content
Definition at line 118 of file CustomTextExport.php.
◆ createJson()
| Fossology\Lib\Application\CustomTextExport::createJson |
( |
|
$phrases | ) |
|
|
private |
Create JSON content from result array.
- Parameters
-
| array | $result | Database result array |
- Returns
- string JSON content
Definition at line 176 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 48 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: