1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace Notebook;
- 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(
- 'title' => 'title',
- 'description' => 'description'
- );
- parent::__construct($stream, $map, $delimiter, $enclosure);
- }
- function get_path()
- {
- return $this->path;
- }
- }
|