| 1 |
<?php |
| 2 |
|
| 3 |
namespace FileBird\Controller\Import; |
| 4 |
|
| 5 |
defined( 'ABSPATH' ) || exit; |
| 6 |
|
| 7 |
class DataImport { |
| 8 |
private static $plugins_import = array(); |
| 9 |
|
| 10 |
public $prefix; |
| 11 |
public $name; |
| 12 |
public $author; |
| 13 |
public $taxonomy; |
| 14 |
public $counter; |
| 15 |
public $completed; |
| 16 |
public $noThanks; |
| 17 |
public $description; |
| 18 |
|
| 19 |
public function __construct( $prefix, $attributes ) { |
| 20 |
$this->prefix = $prefix; |
| 21 |
|
| 22 |
foreach ( $attributes as $key => $value ) { |
| 23 |
$this->{$key} = $value; |
| 24 |
} |
| 25 |
|
| 26 |
static::$plugins_import[ $prefix ] = $this; |
| 27 |
} |
| 28 |
|
| 29 |
public static function get( $prefix = 'all' ) { |
| 30 |
if ( $prefix === 'all' ) { |
| 31 |
return static::$plugins_import; |
| 32 |
} else { |
| 33 |
return static::$plugins_import[ $prefix ]; |
| 34 |
} |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
|