| 1 | <?php |
||
| 18 | class Exporter |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var string output files path |
||
| 22 | */ |
||
| 23 | public $output_path; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string date format to be used in the date function such as 'Y-m-d' |
||
| 27 | */ |
||
| 28 | public $date_format; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Exporter constructor. |
||
| 32 | * |
||
| 33 | * @param string $outputPath |
||
| 34 | * @param string $date_format |
||
| 35 | */ |
||
| 36 | 11 | public function __construct($outputPath, $date_format = 'Y-m-d') |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Serialize the entities. |
||
| 44 | * |
||
| 45 | * @param array $entities |
||
| 46 | * @param string $listId name of the list to serialized |
||
| 47 | */ |
||
| 48 | 2 | public function serialize($entities, $listId) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Create a json file. |
||
| 56 | * |
||
| 57 | * @param array $entities |
||
| 58 | * @param string $listId name of the list to encode |
||
| 59 | */ |
||
| 60 | 10 | public function json($entities, $listId) |
|
| 65 | } |
||
| 66 |