You are here

function relation_load in Relation 7

Loads a relation from a relation id.

Parameters

$rid: Numerical id of the relation to be loaded.

Return value

Loaded relation object. Relation objects are stdClass Object of the form:

  • rid: numeric relation id.
  • relation_type: relation bundle machine name.
  • arity: the number of entities in the relation
  • rdf_mapping: not yet implemented (empty array)
  • endpoints: Field holding the entities that make up the relation. Field columns are:

    • entity_type: The type of the entity (eg. node).
    • entity_id: Numeric entity ID.
10 calls to relation_load()
MigrateDestinationRelation::import in relation_migrate/relation_migrate.destination.inc
Import a single relation.
RelationAPITestCase::testRelationDelete in tests/relation.test
Tests relation delete.
RelationAPITestCase::testRelationRevision in tests/relation.test
Tests relation revisions.
RelationFeedsProcessor::entityLoad in relation_feeds/RelationFeedsProcessor.inc
RelationRulesTestCase::testRelationCreateRelation in tests/relation.rules.test
Test to create a relation in different ways by executing a rule.

... See full list

File

./relation.module, line 458
Describes relations between entities.

Code

function relation_load($rid, $vid = NULL, $reset = FALSE) {
  $conditions = isset($vid) ? array(
    'vid' => $vid,
  ) : array();
  $relations = relation_load_multiple(array(
    $rid,
  ), $conditions, $reset);
  return reset($relations);
}