EntityFieldQuery::entityOrderBy

7 entity.inc public EntityFieldQuery::entityOrderBy($name, $direction = 'ASC')
8 entity.query.inc public EntityFieldQuery::entityOrderBy($name, $direction = 'ASC')

Orders the result set by entity-generic metadata.

If called multiple times, the query will order by each specified column in the order this method is called.

Note: The "comment" and "taxonomy_term" entity types don't support ordering by bundle. For "taxonomy_term", propertyOrderBy('vid') can be used instead.

Parameters

$name: 'entity_type', 'bundle', 'revision_id' or 'entity_id'.

$direction: The direction to sort. Legal values are "ASC" and "DESC".

Return value

EntityFieldQuery The called object.

File

includes/entity.inc, line 848

Code

public function entityOrderBy($name, $direction = 'ASC') {
  $this->order[] = array(
    'type' => 'entity', 
    'specifier' => $name, 
    'direction' => $direction,
  );
  return $this;
}
Login or register to post comments