Find all entities of a given type?
You're looking for the EntityFieldQuery class:

$query = new EntityFieldQuery;

$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'article')
  -&gt;fieldCondition('field_my_field', 'value', 'a_value')
  -&gt;propertyCondition('status', 1)
  -&gt;fieldOrderBy('field_my_field', 'value', 'DESC');

$results = $query-&gt;execute();
if (isset($results['node'])) {
  $nodes = node_load_multiple(array_keys($results['node']));

  foreach ($nodes as $nid =&gt; $node) {
    // Do something with the node object
  }
}


The above code loads all node entities with a content type of article. It filters on a custom field called field_my_field and the status property of the node. I only put that in for reference you wouldn't need it to load all nodes without any filters. Same goes for the order by statement.

Hope that helps.