event->attach("beforeProcessing",array($this,"before_check_key")); $this->event->attach("afterProcessing",array($this,"after_check_key")); } public function before_check_key($action){ if ($action->get_value($this->config->id["name"])=="") $action->error(); } public function after_check_key($action){ if ($action->get_status()=="inserted" || $action->get_status()=="updated"){ $action->success($action->get_value($this->config->id["name"])); $action->set_status("inserted"); } } };