| 1 |
<?php |
| 2 |
|
| 3 |
namespace ImportWP\Common\AddonAPI\Exporter; |
| 4 |
|
| 5 |
class ExporterData |
| 6 |
{ |
| 7 |
private $_template_type; |
| 8 |
private $_args = []; |
| 9 |
private $_record = []; |
| 10 |
|
| 11 |
/** |
| 12 |
* @var GroupData[] |
| 13 |
*/ |
| 14 |
private $_groups = []; |
| 15 |
|
| 16 |
public function __construct($template_type, $args = []) |
| 17 |
{ |
| 18 |
$this->_template_type = $template_type; |
| 19 |
$this->_args = $args; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_type() |
| 23 |
{ |
| 24 |
return $this->_template_type; |
| 25 |
} |
| 26 |
|
| 27 |
public function get_args() |
| 28 |
{ |
| 29 |
return $this->_args; |
| 30 |
} |
| 31 |
|
| 32 |
public function get_record() |
| 33 |
{ |
| 34 |
return $this->_record; |
| 35 |
} |
| 36 |
|
| 37 |
public function get_group($group_id) |
| 38 |
{ |
| 39 |
if (!isset($this->_groups[$group_id])) { |
| 40 |
$this->_groups[$group_id] = new GroupData($group_id, []); |
| 41 |
} |
| 42 |
return $this->_groups[$group_id]; |
| 43 |
} |
| 44 |
|
| 45 |
public function load_record($record) |
| 46 |
{ |
| 47 |
$this->_record = $record; |
| 48 |
} |
| 49 |
|
| 50 |
public function get_groups() |
| 51 |
{ |
| 52 |
return $this->_groups; |
| 53 |
} |
| 54 |
} |
| 55 |
|