

Code: Select all
class ControllerExtensionModuleCustomergroupmodifier extends Controller {
private $error = array();
public function index() {...}
protected function validate() {}
public function install()
{
$this->load->model('setting/event');
$this->model_setting_event->addEvent(
'module_customergroupmodifier_admin',
'admin/model/customer/customer/addCustomer/before',
'extension/module/customergroupmodifier/addCustomer'
);
$this->model_setting_event->addEvent(
'module_customergroupmodifier_restadmin',
'catalog/model/rest/restAdmin/addCustomer/before',
'extension/module/customergroupmodifier/addCustomer'
);
$this->log->write('module installed!');
}
public function uninstall()
{
$this->load->model('setting/event');
$this->model_setting_event->deleteEventByCode(
'module_customergroupmodifier_admin'
);
$this->model_setting_event->deleteEventByCode(
'module_customergroupmodifier_restadmin'
);
$this->log->write('module uninstalled!');
}
public function addCustomer(&$eventRoute, &$data) {
foreach ($data[0] as $key => $value) {
if (is_array($value)) $value = json_encode($value);
$this->log->write($key . '=' . $value);
}
}
}