Quantcast
Viewing all articles
Browse latest Browse all 293035

Document EntityFieldQuery::tableSort usage

API page: http://api.drupal.org/api/drupal/includes%21entity.inc/function/EntityFi...

I'm having trouble working out how to use EntityFieldQuery's "tableSort" functionality. The docs refer to an "EFQ Header array" - even with the example provided in the comments (drawn from entity_query.test) it's not apparent how to build one of these, how it differs from a normal TableSort header, what the specifier/type keys are, or what to do to get the whole thing to work with theme_table.

I've had some success with simple properties, by simply including both (EFQ) specifier/type and (theme_table) field, like so:

<?php
  $header
= array(
   
'sku'=> array(
     
'data'=> t('Product code'),
     
'type'=> 'property',
     
'specifier'=> 'sku',
     
'field'=> 'sku',
    ),
  );
?>

... But this does not help me sort by field values or - heaven forfend - field values on referenced entities.


Viewing all articles
Browse latest Browse all 293035

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>