Retrieve taxonomy terms with EntityFieldQuery for a given parent term I am retrieving a tid of a taxonomy term by using EntityFieldQuery. However, I need to cross-link the taxonomy_term_hierarchy table to list those terms which have a particular parent, but I am not able to get it. In the code below

$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'taxonomy_term')
      -&gt;propertyCondition('vid', $vocabulary)
      -&gt;propertyCondition('name', $termino)
      -&gt;propertyCondition('parent', $parent_id)


the last line is throwing the following (expected) error. The same code, without the last property condition, works correctly. How can I achieve the result?

The returned error is:


  PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'taxonomy_term_data.parent' in 'where clause'
Using only the EntityFieldQuery class, you cannot because the information about the taxonomy hierarchy is not contained in the database table used for the entity data, but in the taxonomy_term_hierarchy table. 

You would need to first get all the taxonomy term IDs having $parent_id as parent, from that table, and then use the EntityFieldQuery class for the other part of the query. Truly, the EntityFieldQuery class is excessive, in this case, since its purpose is to make a query involving the values of field attached to an entity. It also slower than a normal query done with db_select(), and you would not get any benefit, in this case.