PluginProbe
Import WP – CSV & XML Import Export for WordPress / trunk
Import WP – CSV & XML Import Export for WordPress vtrunk
2.14.24 2.14.23 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.9.0 2.9.1 trunk 0.1.6 All 142 releases
jc-importer / class / Common / Addon / AddonBaseGroup.php

AddonBaseGroup.php in Import WP – CSV & XML Import Export for WordPress trunk, at class/Common/Addon/AddonBaseGroup.php

61 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImportWP\Common\Addon;
4
5 /**
6 * @deprecated 2.14.0
7 */
8 class AddonBaseGroup extends AddonBaseContainer implements AddonGroupInterface
9 {
10 /**
11 * @var callable
12 */
13 protected $_process_callback;
14
15 protected $_is_field_processable = false;
16
17 protected $_id;
18
19 public function _enable_processing()
20 {
21 $this->_is_field_processable = true;
22 }
23
24 public function _is_processing_enabled()
25 {
26 return $this->_is_field_processable;
27 }
28
29 public function __construct($addon, $id, $data)
30 {
31 $this->_id = $id;
32 parent::__construct($addon, array_merge($data, ['type' => 'group']));
33 }
34
35 public function _process($object_id, $data, $importer_model, $template)
36 {
37 if (!is_null($this->_process_callback) && is_callable($this->_process_callback)) {
38 call_user_func($this->_process_callback, new AddonGroupDataApi($this->addon(), $this, $object_id, $this->get_id(), $data, $importer_model, $template));
39 }
40 }
41
42 public function save($callback)
43 {
44 $this->_process_callback = $callback;
45 return $this;
46 }
47
48 public function get_id()
49 {
50 return $this->_id;
51 }
52
53 /**
54 * @return AddonBaseField[]
55 */
56 public function fields()
57 {
58 return isset($this->_data['fields']) ? $this->_data['fields'] : [];
59 }
60 }
61