12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace Glossary;
- use Chamilo;
- class CsvWriter extends \CsvObjectWriter
- {
-
- public static function create($path = '', $delimiter = ';', $enclosure = '"')
- {
- return new self($path, $delimiter, $enclosure);
- }
-
- protected $path = '';
- function __construct($path = '', $delimiter = ';', $enclosure = '"')
- {
- $path = $path ? $path : Chamilo::temp_file();
- $this->path = $path;
- $stream = new \FileWriter($path);
- $map = array(
- 'name' => 'name',
- 'description' => 'description'
- );
- parent::__construct($stream, $map, $delimiter, $enclosure);
- }
-
- function get_path()
- {
- return $this->path;
- }
-
-
- }
|