feature;
// expand the feature object to include the feature relationships.
// since there two foreign keys (object_id and subject_id) in the
// feature_relationship table, we will access each one separately
$feature = tripal_core_expand_chado_vars($feature,
'table','feature_relationship', array('order_by'=>array('rank' => 'ASC')));
// get the featurelocs. if only one featureloc exists then we want to convert
// the object into an array, otherwise the value is an array
$orelationships = $feature->feature_relationship->object_id;
if (!$orelationships) {
$orelationships = array();
} elseif (!is_array($orelationships)) {
$orelationships = array($orelationships);
}
// do the same for the subject relationships
$srelationships = $feature->feature_relationship->subject_id;
if (!$srelationships) {
$srelationships = array();
} elseif (!is_array($srelationships)) {
$srelationships = array($srelationships);
}
// now combine the two
$relationships = array_merge($orelationships,$srelationships);
?>
Relationships
Subject relationships
0){ ?>
Subject |
Type |
Relationship |
Object |
Type |
subject_id->name;
if(!$subject_name){
$subject_name = $relationship->subject_id->uniquename;
}
$object_name = $relationship->object_id->name;
if(!$object_name){
$object_name = $relationship->object_id->uniquename;
}?>
|
subject_id->type_id->name?> |
type_id->name?> |
object_id->nid)){
print "object_id->nid) . "\">$object_name";
} else {
print "$object_name";
}?>
|
object_id->type_id->name?> |
There are no subject relationships for this feature
Object relationships
0){ ?>
Subject |
Type |
Relationship |
Object |
Type |
subject_id->name;
if(!$subject_name){
$subject_name = $relationship->subject_id->uniquename;
}
$object_name = $relationship->object_id->name;
if(!$object_name){
$object_name = $relationship->object_id->uniquename;
}?>
subject_id->nid)){
print "subject_id->nid) . "\">$subject_name";
} else {
print "$subject_name";
}?>
|
subject_id->type_id->name?> |
type_id->name?> |
|
object_id->type_id->name?> |
There are no object relationships for this feature