# jc-importer/trunk/class/Common/Addon/AddonBaseGroup.php

Import WP – CSV &amp; XML Import Export for WordPress, version trunk. 61 lines.

- Page: https://pluginprobe.com/plugins/jc-importer/trunk/code/class/Common/Addon/AddonBaseGroup.php
- Raw: https://pluginprobe.com/plugins/jc-importer/trunk/raw/class/Common/Addon/AddonBaseGroup.php
- Modified: 2024-07-14T15:13:26+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/jc-importer/trunk/code/class/Common/Addon/AddonBaseGroup.php#L10-L20`.

```php
<?php

namespace ImportWP\Common\Addon;

/**
 * @deprecated 2.14.0
 */
class AddonBaseGroup extends AddonBaseContainer implements AddonGroupInterface
{
    /**
     * @var callable
     */
    protected $_process_callback;

    protected $_is_field_processable = false;

    protected $_id;

    public function _enable_processing()
    {
        $this->_is_field_processable = true;
    }

    public function _is_processing_enabled()
    {
        return $this->_is_field_processable;
    }

    public function __construct($addon, $id, $data)
    {
        $this->_id = $id;
        parent::__construct($addon, array_merge($data, ['type' => 'group']));
    }

    public function _process($object_id, $data, $importer_model, $template)
    {
        if (!is_null($this->_process_callback) && is_callable($this->_process_callback)) {
            call_user_func($this->_process_callback, new AddonGroupDataApi($this->addon(), $this, $object_id, $this->get_id(), $data, $importer_model, $template));
        }
    }

    public function save($callback)
    {
        $this->_process_callback = $callback;
        return $this;
    }

    public function get_id()
    {
        return $this->_id;
    }

    /**
     * @return AddonBaseField[]
     */
    public function fields()
    {
        return isset($this->_data['fields']) ? $this->_data['fields'] : [];
    }
}

```
