You are here

protected function RestfulDataProviderEFQ::addExtraInfoToQuery in RESTful 7

Adds query tags and metadata to the EntityFieldQuery.

Parameters

\EntityFieldQuery $query: The query to enhance.

Overrides RestfulBase::addExtraInfoToQuery

2 calls to RestfulDataProviderEFQ::addExtraInfoToQuery()
RestfulDataProviderEFQ::getQueryCount in plugins/restful/RestfulDataProviderEFQ.php
Prepare a query for RestfulEntityBase::getTotalCount().
RestfulDataProviderEFQ::getQueryForList in plugins/restful/RestfulDataProviderEFQ.php
Prepare a query for RestfulEntityBase::getList().

File

plugins/restful/RestfulDataProviderEFQ.php, line 332
Contains \RestfulDataProviderEFQ

Class

RestfulDataProviderEFQ
@file Contains \RestfulDataProviderEFQ

Code

protected function addExtraInfoToQuery($query) {
  parent::addExtraInfoToQuery($query);
  $entity_type = $this
    ->getEntityType();

  // The only time you need to add the access tags to a EFQ is when you don't
  // have fieldConditions.
  if (empty($query->fieldConditions)) {

    // Add a generic entity access tag to the query.
    $query
      ->addTag($entity_type . '_access');
  }
  $query
    ->addMetaData('restful_handler', $this);
}