| 1 |
<?php |
| 2 |
/** |
| 3 |
* Abstract class for record exporters |
| 4 |
* |
| 5 |
* @package WP_Stream |
| 6 |
*/ |
| 7 |
|
| 8 |
namespace WP_Stream; |
| 9 |
|
| 10 |
/** |
| 11 |
* Class - Exporter |
| 12 |
*/ |
| 13 |
abstract class Exporter { |
| 14 |
/** |
| 15 |
* Exporter name |
| 16 |
* |
| 17 |
* @var string |
| 18 |
*/ |
| 19 |
public $name; |
| 20 |
|
| 21 |
/** |
| 22 |
* Exporter slug |
| 23 |
* |
| 24 |
* @var string |
| 25 |
*/ |
| 26 |
public $slug; |
| 27 |
|
| 28 |
/** |
| 29 |
* Output formatted data for download |
| 30 |
* |
| 31 |
* @param array $data Array of data to output. |
| 32 |
* @param array $columns Column names included in data set. |
| 33 |
* @return void |
| 34 |
*/ |
| 35 |
abstract public function output_file( $data, $columns ); |
| 36 |
|
| 37 |
/** |
| 38 |
* Allow connectors to determine if their dependencies is satisfied or not |
| 39 |
* |
| 40 |
* @return bool |
| 41 |
*/ |
| 42 |
public function is_dependency_satisfied() { |
| 43 |
return true; |
| 44 |
} |
| 45 |
} |
| 46 |
|