Beispiel #1
0
 /**
  * Object create callback
  *
  * @param mixed $handler_id The ID of the handler.
  */
 function &dm2_create_callback(&$controller)
 {
     $this->_object = new fi_opengov_datacatalog_dataset_dba();
     $this->_object->organization = array_pop($_POST['fi_opengov_datacatalog_organization_chooser_widget_selections']);
     $this->_object->license = array_pop($_POST['fi_opengov_datacatalog_license_chooser_widget_selections']);
     if (!$this->_object->create()) {
         debug_push_class(__CLASS__, __FUNCTION__);
         debug_print_r('We operated on this object:', $this->_object);
         debug_pop();
         $_MIDCOM->generate_error(MIDCOM_ERRNOTFOUND, 'Failed to create a new dataset, cannot continue. Last Midgard error was: ' . midcom_application::get_error_string());
         // This will exit.
     }
     /* if the dataset is created based on a suggestion then delete the suggestion */
     if (isset($this->_defaults['suggestion'])) {
         $suggestion = new fi_opengov_datacatalog_dataset_suggestion_dba($this->_defaults['suggestion']);
         $suggestion->delete();
     }
     return $this->_object;
 }