|
@@ -403,7 +403,6 @@ class sbo__relationship extends ChadoField {
|
|
|
$object_type = $entity->{$field_name}['und'][$delta]['value']['local:relationship_object']['rdfs:type'];
|
|
|
$object_name = $entity->{$field_name}['und'][$delta]['value']['local:relationship_object']['schema:name'];
|
|
|
|
|
|
-
|
|
|
// Remember the current entity could be either the subject or object!
|
|
|
// Example: The genetic_marker, MARKER1 , derives from the sequence_variant, VARIANT1.
|
|
|
// The above relationship will be shown both on marker and variant pages
|
|
@@ -464,22 +463,6 @@ class sbo__relationship extends ChadoField {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // Not all tables have the columns named 'subject_id' and 'object_id'.
|
|
|
- // some have variations on that name and we need to determine what they are.
|
|
|
- $fkeys = $schema['foreign keys'];
|
|
|
- $subject_id_key = 'subject_id';
|
|
|
- $object_id_key = 'object_id';
|
|
|
- foreach ($fkeys as $fktable => $details) {
|
|
|
- foreach ($details['columns'] as $fkey_lcolumn => $fkey_rcolumn) {
|
|
|
- if (preg_match('/^subject_.*id/', $fkey_lcolumn)) {
|
|
|
- $subject_id_key = $fkey_lcolumn;
|
|
|
- }
|
|
|
- if (preg_match('/^object_.*id/', $fkey_lcolumn)) {
|
|
|
- $object_id_key = $fkey_lcolumn;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// Set some defaults for the empty record.
|
|
|
$entity->{$field_name}['und'][0] = array(
|
|
|
'value' => '',
|
|
@@ -949,7 +932,8 @@ class sbo__relationship extends ChadoField {
|
|
|
$type_id = $item['chado-' . $field_table . '__type_id'];
|
|
|
$type_id = isset($item['type_id']) ? $item['chado-' . $field_table . '__type_id'] : $type_id;
|
|
|
$type_name = isset($item['type_name']) ? $item['type_name'] : '';
|
|
|
- $subject_name = isset($item['subject_name']) ? $items['subject_name'] : '';
|
|
|
+ $voc_id = isset($item['vocabulary']) ? $item['vocabulary'] : '';
|
|
|
+ $subject_name = isset($item['subject_name']) ? $item['subject_name'] : '';
|
|
|
$object_name = isset($item['object_name']) ? $item['object_name'] : '';
|
|
|
|
|
|
// If the row is empty then just continue, there's nothing to validate.
|