| 97 | | $this->_controller->set_storage($this->_object, 'metadata'); |
|---|
| | 97 | // Check if we have metadata schema defined in the schemadb specific for the object's schema or component |
|---|
| | 98 | $object_schema = $this->_object->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
|---|
| | 99 | $component_schema = str_replace('.', '_', $_MIDCOM->get_context_data(MIDCOM_CONTEXT_COMPONENT)); |
|---|
| | 100 | if ( $object_schema == '' |
|---|
| | 101 | || !isset($this->_schemadb[$object_schema])) |
|---|
| | 102 | { |
|---|
| | 103 | if (isset($this->_schemadb[$component_schema])) |
|---|
| | 104 | { |
|---|
| | 105 | // No specific metadata schema for object, fall back to component-specific metadata schema |
|---|
| | 106 | $object_schema = $component_schema; |
|---|
| | 107 | } |
|---|
| | 108 | else |
|---|
| | 109 | { |
|---|
| | 110 | // No metadata schema for component, fall back to default |
|---|
| | 111 | $object_schema = 'metadata'; |
|---|
| | 112 | } |
|---|
| | 113 | } |
|---|
| | 114 | |
|---|
| | 115 | $this->_controller->set_storage($this->_object, $object_schema); |
|---|