52 $this->obligationMap = $GLOBALS[
'container']->get(
'businessrules.obligationmap');
81 $sql =
"SELECT ob_pk,ob_type,ob_topic,ob_text,ob_classification,ob_modifications,ob_comment 82 FROM obligation_ref;";
84 $stmt = __METHOD__.
'.ob';
85 $sql .=
' WHERE ob_pk=$'.$ob;
86 $row = $this->
dbManager->getSingleRow($sql,$stmt);
87 $vars = $row ? array( $row ) : array();
88 $liclist = $this->obligationMap->getLicenseList($ob);
89 $candidatelist = $this->obligationMap->getLicenseList($ob, True);
91 array_push($vars,$liclist);
92 array_push($vars,$candidatelist);
101 foreach ($vars as $row) {
102 $liclist = $this->obligationMap->getLicenseList($row[
'ob_pk']);
103 $candidatelist = $this->obligationMap->getLicenseList($row[
'ob_pk'], True);
105 array_push($row,$liclist);
106 array_push($row,$candidatelist);
107 array_push($csvarray,$row);
111 $out = fopen(
'php://output',
'w');
113 $head = array(
'Type',
'Obligation or Risk topic',
'Full Text',
'Classification',
'Apply on modified source code',
'Comment',
'Associated Licenses',
'Associated candidate Licenses');
114 fputcsv($out, $head, $this->delimiter, $this->enclosure);
115 foreach ($csvarray as $row) {
116 fputcsv($out, $row, $this->delimiter, $this->enclosure);
118 $content = ob_get_contents();
Helper class to export obligations as a CSV.
setDelimiter($delimiter=',')
Update the delimiter.
Utility functions for specific applications.
createCsv($ob=0)
Create CSV from the obligations.
fo_dbManager * dbManager
fo_dbManager object
__construct(DbManager $dbManager)
setEnclosure($enclosure='"')
Update the enclosure.