You are here

function relation_query in Relation 7

Same name and namespace in other branches
  1. 8.2 relation.module \relation_query()
  2. 8 relation.module \relation_query()

Returns a query object to find related entities.

Parameters

$entity_type: (optional) The entity type of one of the endpoints.

$entity_id: (optional) The entity id of one of the endpoints. Can also be an array of entity IDs.

$r_index: (optional) The index of the search entity in the relation to be found (0 = source, 1 = target).

Return value

RelationQuery The query object itself.

1 call to relation_query()
relation_relation_exists in ./relation.module
Checks if a relation exists.

File

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

Code

function relation_query($entity_type = NULL, $entity_id = NULL, $r_index = NULL) {
  return new RelationQuery($entity_type, $entity_id, $r_index);
}